Data authoring with metaphactory's semantic forms

Authoring

Dmitry Pavlov

·

·

Reading time: 4 - 8 minutes

Data authoring with metaphactory's semantic forms

Forms are a key instrument for collecting and authoring data, while knowledge graphs are the de facto standard for modeling and representing human knowledge. metaphactory delivers a highly configurable semantic form component that empowers you to build user-friendly form interfaces based on the semantic model (ontology1) in the underlying knowledge graph. End users can use these form interfaces to edit existing data, create new data, and interlink resources in the knowledge graph.

In this blog post, we will provide an introduction to semantic forms in metaphactory and discuss how they support data authoring use cases on top of knowledge graphs. To demonstrate how metaphactory's semantic forms work in practice, we will look at a practical example and will augment the Nobel Prize Dataset with information about scholarly articles. The Nobel Prize Dataset is a public dataset available as a Semantic Knowledge Graph, i.e., it is published in RDF and described by an OWL ontology. We extended the ontology with SHACL shapes to also model relevant constraints which can be utilized within the forms. The ontology and dataset include information about all Laureates (Persons, Organizations) who have received a Nobel Prize Laureate Award in a certain Category, or a share thereof, ever since the inception of the Nobel Prize2. Our aim will be to extend this information to include details about scholarly articles published by these laureates.

Introduction to metaphactory's semantic forms

As mentioned above, metaphactory's semantic form component allows you to generate end-user oriented authoring forms based on the underlying ontology (semantic model), i.e., for any class represented in that ontology. However, in many cases, the intent is to author a complete subgraph encompassing several connected classes, while providing a simple authoring form to end users. Therefore, the forms can be configured to enable authoring of complete subgraphs, while keeping a very simple interaction for the end user.

The information provided by end users through the input form is converted to knowledge graph entities (or instance data) and is immediately accessible, explorable, and searchable within the knowledge graph and through various interfaces, like metaphactory's multiple search interfaces.

To implement the example mentioned before and enrich the Nobel Prize Dataset with information about scholarly articles of laureates, we will need a form which allows end users to create, edit, or remove such data. For this purpose, we have decided to utilize the schema.org ontology to model information about scholarly articles.

The diagram below illustrates the data model3 that will be used, including the relations between the classes and the attributes for the ScholarlyArticle class.

The data model used in this example, based on the Nobel Prize ontology and schema.org ontology

The data model used in this example, based on the Nobel Prize ontology and schema.org ontology

Please note that this is only a small subset of the overall ontology and also only a subset of the attributes for this one class.

metaphactory semantic forms in practice

Let's take a closer look at how configuring and using metaphactory's semantic forms works in practice.

We will use metaphactory's configuration wizard to visually set up and configure the semantic form we referred to at the beginning. The configuration wizard will allow us to select

  • A particular class from the ontologies available in our system and for which we want to input data (in this case, the class ScholarlyArticle from the schema.org ontology)
  • The attributes and relations to be used as input fields in the form

The wizard will also allow us to determine the order in which the input fields will be presented in the UI.

Setting up a semantic form using metaphactory's no-code wizard

Setting up a semantic form using metaphactory's no-code wizard

The ScholarlyArticle class in the ontology inherits over a 100 attributes from more generic schema.org superclasses Thing and CreativeWork. Filling out all of these fields is not required for our purpose, so we limit the fields of the form to the essential ones: the name of an article, its publication date, its author, its publisher, and an associated Nobel Prize award.

Auto-generated semantic form

Auto-generated semantic form

The markup generated by the wizard renders a concise end-user form, including auto-suggestion, date picker, and other convenient settings derived from the ontology definition.

To make the authoring process even simpler and more intuitive for end users, we also include the ability to create new publishers (i.e., new Organization entities for the publisher relation) directly in the form, using a pop-up dialog.

Creation of instance data for other classes from within the form

Creation of instance data for other classes from within the form

As an alternative, we can also create a form with composite inputs allowing for the inline creation of publishers when entering data for a new scholarly article.

Composite form in metaphactory

Composite form in metaphactory

This allows us to maintain the optimal knowledge representation in the model, while providing a simplified interface for entering data.

Finally, using HTML and CSS, we can adjust the styling and design of the form and add some instructions for end users.

Styling forms in metaphactory is easy with HTML & CSS

Styling forms in metaphactory is easy with HTML & CSS

The final configuration for the form is still simple and can easily adjust and be adjusted as the ontology changes:

<div style='margin-top:30px; margin-left:30px; margin-right:30px'>
  <h2>Creation of a scholarly article written by a Nobel Prize laureate</h2>
  <p>With this form a new scholarly article written by a Nobel Prize laureate can be documented. If desired, the scholarly article can be linked to a specific Nobel Prize award. 
  </p>
  <p> If no existing publisher is found in the dataset, it can be created by clicking the "Create new" button.</p>
  <semantic-form 
  for-class="https://schema.org/ScholarlyArticle" 
  new-subject-template="http://example.com/records/{{UUID}}" 
  fields-to-load='[
    "https://schema.org/publisher",
    "https://schema.org/datePublished",
    "https://schema.org/name",
    "https://schema.org/award"
  ]'>
    <semantic-form-input-override for-field='https://schema.org/publisher'>
        <semantic-form-autocomplete-input placeholder='Organization' >
          <semantic-form 
          new-subject-template='http://example.com/records/Publishers/{{UUID}}'
          for-class='https://schema.org/Organization'   
          fields-to-load='[
            "https://schema.org/name",
            "https://schema.org/description"
          ]'>
          </semantic-form>
        </semantic-form-autocomplete-input>
      </semantic-form-input-override>
  </semantic-form>
</div>

Now that we have our form prepared, we can actually create a new scholarly article.

In the screenshot below, we use the created form to document that Elias James Corey wrote an article titled "Retrosynthetic Thinking – Essentials and Examples", which was published in the "Chemical Society Reviews" journal in 1988 and this, together with other publications, led to him becoming a Nobel laureate in Chemistry in 1990.

Creation of instance data using the semantic form

Creation of instance data using the semantic form

If we now search for Retrosynthetic Thinking – Essentials and Examples in our knowledge graph, we will see4 that this entity is related to Elias James Corey via the author relation, with the "Chemistry 1990" Nobel Prize award via the award relation, and with "Chemical Society Reviews" via the publisher relation. The search result does not only prove that we saved the data about the article, but also that we successfully connected it to already existing data from the Nobel Prize dataset.

Visual exploration of authored instance data in metaphactory

Visual exploration of authored instance data in metaphactory

This sounds cool! How can I try it myself?

To test metaphactory's semantic form component, you can get started with metaphactory today using our 14-day free trial. If you'd like to reproduce the example in this blog post, you can download the Nobel Prize dataset here5 and the Nobel Prize Ontology from our public GIT repository »

And, of course, don't hesitate to reach out if you want to learn more about how implementing metaphactory and following our approach can accelerate your knowledge management initiatives and bring you from idea to production in just one month.

Make sure to also subscribe to our newsletter or use the RSS feed to stay tuned to further developments at metaphacts.

Footnotes
1 Ontologies are semantic data models that define the types of entities that exist in a given domain and the properties that can be used to describe them. To learn more about metaphatory's ontology modeling capabilities, have a look at this blog post »

2 The snapshot of the dataset linked to this blog post contains data up to 2013 and can be downloaded here (note that that your browser might already unzip the file without properly changing the ending). This public dataset is licensed under Creative Commons Zero (CC0) and free to use as stated by the Terms & Conditions of the Nobel Prize website.

3 To get started with ontology modeling in metaphactory, try out our "Ontology Modeling" tutorial linked in the metaphactory Help section. The tutorial will walk you through the basics of visual ontology modeling and show how you can 1) load ontologies into metaphactory, 2) create new ontologies, 3) create new classes and attributes, and 4) establish relations between classes.

4 This diagram was produced by first providing additional configuration parameters for the label service which allows us to define the attribute to be displayed as a label for each resource type. In our case, we used the attribute "name" as a label for instances of the ScholarlyArticle class. More about configuring the label service can be found in a dedicated help article »

5 Please note that your browser might already unzip the file without properly changing the ending.

Dmitry Pavlov

As Director of Customer Success at metaphacts, Dmitry is responsible for making sure that our clients have a positive and rewarding experience with metaphactory and he drives many customer-oriented product improvement initiatives to make this experience even smoother.