Create a Custom Ontology

This section contains a short guide on how to create a custom ontology.

  1. Open the Ontology Management.

  2. Click New Ontology, or the Custom Ontologiesnode,or select New Ontology in the context menu.

  3. In the New Ontology dialogue in the Metadata tab enter the details, the Title and an optional description for your ontology.

    23899653.png
  4. In the Languages tab, select one or more languages for the ontology (optional, default: 'No Language'). The languages you select here will be available to define labels and descriptions for classes, relations and attributes respectively.

    23899651.png
  5. In theUser Groups tab you can select from existing user groups, to define which users should be able to access and edit the ontology.

    23899650.png
  6. In the Advanced tab you can define the URI pattern used for your ontology (optional). Details find in this topic: Define the URI Pattern for a Custom Ontology or Custom Scheme

    • Base URI: this is pre-filled with the setting defined for ontologies in the poolparty.properties file, but you can change it to a Base URI of your choice.

    • Ontology Identifier: this is pre-filled with the title of the ontology you chose, which will be used without spaces as part of the URI.

    • Resource Separator: the radio buttons for the type of separator you want to be used in the URIs based on this ontology (default: Slash).

      23899654.png
  7. Click Save to confirm your changes.

Once the ontology has been created you can:

Create Custom Classes

This section contains a short guide on how to create a new custom class.

Prerequisites for Creating a Custom ClassHow to Create a New Custom Class in a Custom Ontology

To create a new class:

  1. Open your custom ontology.

  2. Either right-click New Class in the Hierarchy Tree.

  3. Or press New Class in Details View.

  4. The Add Classdialogue opens.In the Add Class dialogue you have the following options:

    • Label: enter the name of the class (mandatory).

      Available classes from all active predefined and custom ontologies are displayed as you start typing in the Labelfield, via autocomplete. That way you can reuse existing classes.

    • URI: the URI will be filled withURI pattern defined creating your custom ontology. The pattern is greyed out per default and will be extended by the specified label which will be used without spaces.You can click in the URI field to make it active and define a specific URI if needed.

    • Subclass Of: choose this option if a class is a subclass of another class. Select the parent class from the drop down.

    • Disjoint With: select this option, if the current class and another class cannot share an instance regardless of how the classes are interpreted.

  5. Click Create.

  6. You have more options in the Description tab where you can add a description for the new class.

  7. Select a Language (7) of the description. This list depends on the language settings for the project.

    51732596.png

23898884.pngBelow, you can find the owl statements created for a class. As you can see a class is defined as an owl:Class and rdfs:label is used for the name. The rdfs:subClassOf relation is used to specify the sub-class relation and owl:disjointWith to specify the disjoint classes. Finally, rdfs:comment is used for the description.

<http://doku.poolparty.biz/cocktail-ontology/Syrup> a owl:Class;
  dcterms:created "2019-02-03T12:16:12.662Z"^^xsd:dateTime;
  dcterms:creator <http://resource.semantic-web.at/user/admin>;
  rdfs:label "Syrup"@en;
  rdfs:comment "A condiment that is a thick, viscous liquid consisting primarily of a solution of sugar in water."@en
  rdfs:subClassOf <http://doku.poolparty.biz/cocktail-ontology/Sweeteners>;
  owl:disjointWith <http://doku.poolparty.biz/cocktail-ontology/Souces> .
PoolParty Academy Tutorial

(Duration: 22m47s)

Create Custom Relations

This section contains a short guide on how to create a custom relation in a custom ontology.

Prerequisites for Creating a Custom Relation
How to Create a Custom Relation in Your Custom Ontology
  1. Open the Ontology Management by clicking its icon in the toolbar.

  2. Select the Custom Ontologies node and activate the desired ontology's node. Expand it and activate the Relations node.

  3. In the Details View on the right, click Create Relation.

    • Alternatively, double click or right-click the Relations node, select Create Relation from the context-menu.

    • You can also use the Add icon in the Statistics section of the ontology's Details View.

      23899668.png
  4. The Add Relation dialogue opens.

    • In the Add Relation dialogue there are three different relationship types available you can define in the relation type drop down.

    • Per default Directed is selected which will create a directed relation between two resources, which means a relation in one direction from the subject to the object.

      23899674.png
  5. Enter the name of the relation. (mandatory)

    • The URI will be filled with the URI pattern defined creating your custom ontology.

    • The pattern is greyed out per default and will be extended by the specified name which will be used without spaces. Double-click into the URI field to make it active and define a specific URI if needed.

  6. The drop downs, to the left and the right of the relation type selection drop down, represent Domain and Range, respectively.

    • You can select classes that have to be Domain and Range for the defined direct relation. You can select from all classes available in the ontology.

    • In addition the SKOS classes 'Concept' and 'Concept Scheme' are available.

    • Finally selecting 'No restriction' (default) as value allows you to use the relation, regardless of the classes assigned to the resources, between which you create the relation.

    • You have to click Add to confirm a selection.

  7. Click Save to confirm your changes.

The following topics provide details on these relation types:

Optional Settings for Custom Relations
  • Unique Use: if you want this relation to only be used once between two resources, check the box.

  • Is a Sub-Property: if you want this relation to be a sub-property of another, check the box

    A new drop down will then enable you to choose the desired parent relation from the relations in the ontology and all SKOS relations. You have to click Add to make a selection.

    23899675.png
  • To add a description for the new relation, select the Description tab (1).

    Depending on the language settings for the project, select the language of the description from the drop down.

    23899673.png

You can also add custom relations to custom schemes. Details find here: Add Classes, Relations and Attributes to Your Custom Scheme

23898884.pngBelow you can find the owl statements created for a relation. As you can see a directed relation is defined as an owl:ObjectProperty and rdfs:label is used for the name. The rdfs:domain and rdfs:range are used to define the respective class restrictions. Finally rdfs:comment is used for the description. To indicated Unique Use the relation in addition becomes a owl:FunctionalProperty. The definition of a sub-property is done via the rdfs:subPropertyOf relation.

<http://doku.poolparty.biz/cocktail-ontology/Uses-Garnish> a owl:ObjectProperty;
  dcterms:created "2019-02-03T12:41:42.037Z"^^xsd:dateTime;
  dcterms:creator <http://resource.semantic-web.at/user/admin>;
  rdfs:domain <http://doku.poolparty.biz/cocktail-ontology/Cocktail>;
  rdfs:label "Uses Garnish"@en;
  rdsf:comment "Directed relation between a Cocktail and it's Garnish."@en
  rdfs:range <http://doku.poolparty.biz/cocktail-ontology/Garnish> .
PoolParty Academy Tutorial

(Duration: 19m06s)

Create Directed Relations

This section contains a short guide on how to create a directed relation in a custom ontology.

A Directed relation allows you to define a relationship between two concepts where the property is only defined in one direction similar to skos:inScheme.

  1. Open the Ontology Management by clicking its icon in the toolbar.

  2. Select the Custom Ontologies node and activate the desired ontology's node. Expand it and activate the Relations node.

  3. Click Create Relation to open the Add Relation dialogue.

  4. In the Definition tab, use the field Relation name to enter a name (label) of your choice. Use the drop down in the middle to select the type.

    • Select domain and range from the drop downs to the left and to the right. Click Add for each to confirm your choice.

    • Based on the label, a URI is suggested automatically. If needed, you can edit the suggested URI by clicking its field. By default it is greyed out.

  5. The check boxes for Unique Use and Is a Sub-Property are available and have the following effect:

    • Unique Use: check this to define if the relation can be used between resources just once.

    • Is a Sub-Property: checked it means that the relation according to the SKOS standard is a subproperty of another one. After having checked this, a drop down lets you choose from other existing relations.

24577132.png

In the Description tab you can enter a descriptive text for the relation.

Depending on the languages you have defined for the ontology you can also select the language for that description from a drop down.

24577133.png

Click Save to confirm your changes.

You can also add custom relations to custom schemes.

Create Symmetric Relations

This section contains a short guide on how to create a symmetric relations in a custom ontology.

The Symmetric relation expresses a relationship between two concepts where the same property is used in both directions, similar to the skos:related property.

Creating a symmetric relation follows the process outlined here: Create Custom Relations

In the Add Relations dialogue once you have selected 'Symmetric' in the relation type drop down (1) only the Domain Class selection is active (2).

You have the following options:

  • Enter the name of the relation. (mandatory)

  • The URI will be filled with the URI pattern defined creating your custom ontology. The pattern is greyed out per default and will be extended by the specified name which will be used without spaces. You can double-click into the URI field to make it active and define a specific URI if needed.

  • In drop downs, to the left and the right of the relation type selection drop down, represent Domain and Range, respectively. You can select classes that have to be Domain and Range for the defined symmetric relation.

  • You can select from all classes available in the ontology.

  • In addition the SKOS classes 'Concept' and 'Concept Scheme' are available.

  • Finally selecting 'No restriction' (default) allows you to use the relation, regardless of the classes you assigned to the resources between which the relation is created.

  • You have to click Add to make a selection.

The example below allows to create a symmetric relation between two resources that have the class 'Cocktail' assigned, indicating that those cocktails are variants of each other:

23899681.png

23898884.pngBelow you can find the owl statements created for a symmetric relation. As you can see symmetric relations are created as owl:SymmetricProperty. Besides that all definitions are equal to the creation of all other relations.

<http://doku.poolparty.biz/cocktail-ontology/variantOf> a owl:SymmetricProperty;
  rdfs:domain <http://doku.poolparty.biz/cocktail-ontology/Cocktail>;
  rdfs:label "variantOf";
  rdfs:range <http://doku.poolparty.biz/cocktail-ontology/Cocktail> .

Create Inverse Relations

This section contains a short guide on how to create an inverse relation in a custom ontology.

The Inverse relation expresses a relationship between two concepts where the different properties are used in both directions, similar to the skos:broader and skos:narroewer property.

Creating an inverse relations follows the process outlined here: Create Custom Relations

In the Add Relations dialogue once you have selected Inverse in the relation type drop down (1), an additional row for the definition of the second, inverse relation becomes visible.

You have the following options:

Create the First Part of the Inverse Relation
  • Enter the name of the first relation. (mandatory)

  • The URI for the first relation will be filled with the URI pattern defined creating your custom ontology. The pattern is greyed out per default and will be extended by the specified name which will be used without spaces. You can double-click into the URI field to make it active and define a specific URI if needed.

  • In drop downs, to the left and the right of the relation type selection drop down, represent Domain and Range, respectively. You can select classes that have to be Domain and Range for the defined inverse relation.

  • You can select from all classes available in the ontology.

  • In addition the SKOS classes 'Concept' and 'Concept Scheme' are available.

  • Finally selecting 'No restriction' (default) allows you to use the relation independent from the classes assigned to the resources between which the relation is created.

  • You have to click Add to make a selection.

Create the Second Part of the Inverse Relation
  • Enter the name for the second relation. (mandatory)

  • The URI for the second relation will be filled with the URI pattern defined creating your custom ontology. The pattern is greyed out per default and will be extended by the specified name which will be used without spaces. You can double-click into the URI field to make it active and define a specific URI if needed.

The example below allows to create an inverse relation between two resources, where one has to have the class 'Cocktail' and the other has to have the class 'Ingredients' assigned. That way you can specify all ingredients of a cocktail.

23899686.png

23898884.pngBelow you can find the owl statements created for an inverse relation. As you can see inverse relations are created as owl:ObjectProperty. The inverse relation is indicated by the owl:inverse relation. Besides that all definitions are equal to the creation of all other relations.

<http://doku.poolparty.biz/cocktail-ontology/hasIngredient> a owl:ObjectProperty;
  rdfs:domain <http://doku.poolparty.biz/cocktail-ontology/Cocktail>;
  rdfs:label "hasIngredient"@en;
  rdfs:range <http://doku.poolparty.biz/cocktail-ontology/Ingredients>;
  owl:inverseOf <http://doku.poolparty.biz/cocktail-ontology/ingredientOf> .


<http://doku.poolparty.biz/cocktail-ontology/ingredientOf> a owl:ObjectProperty;
  rdfs:domain <http://doku.poolparty.biz/cocktail-ontology/Ingredients>;
  rdfs:label "ingredientOf"@en;
  rdfs:range <http://doku.poolparty.biz/cocktail-ontology/Cocktail>;
  owl:inverseOf <http://doku.poolparty.biz/cocktail-ontology/hasIngredient> .

Create Custom Attributes

This section contains a short guide on how to create custom attributes for a custom ontology.

Prerequisites for Creating a Custom AttributeHow to Create a Custom Attribute in Your Custom Ontology
  1. In the Details View on the right, click New Attribute.

  2. Alternatively, right-click the Attributes node, select New Attribute from the context-menu.

    51732638.png
  3. In the New Attribute dialogue you have the following options:

    • Label: enter the name of the attribute. (mandatory)

      Available classes from all active predefined and custom ontologies are displayed as you start typing in the Label field, via autocomplete. That way you can reuse existing classes.

    • URI: the URI will be filled with URI pattern defined creating your custom ontology. The pattern is greyed out per default and will be extended by the specified label which will be used without spaces. You can double-click into the URI field to make it active and define a specific URI if needed.

    51732636.png
  4. Select the Type of attribute, for example URI.

    • The selected type determines the data type of your relation.

    • You can find a list of available data types here: Available Attribute Types

    • All other settings are optional.

  5. Click Save to to confirm your changes.

Optional Settings for Custom Attributes
  • In the Usage section you find the Multiple Use (Default) and Unique Use radio buttons. Select to define whether an attribute can be used multiple times or only once per resource.

  • Is a Sub-Property: if you want this attribute to be a sub-property of another, check the box.

    • A new drop down will enable you to choose the desired parent attribute from the relations in the ontology and all SKOS relations.

    • You have to click Add to make a selection.

      23899693.png
  • In the Description tab you can enter a descriptive text for the attribute.

    23899692.png

    Depending on the languages you have defined for the ontology you can also select the language for that description from a drop down.

You can also add custom relations to custom schemes. Details find here: Add Classes, Relations and Attributes to Your Custom Scheme

23898884.pngBelow you can find the owl statements created for an attribute. As you can see a directed relation is defined as an owl:DataTypeProperty and rdfs:label is used for the name. rdfs:domain is used used to define the respective class restrictions for the Domain. rdfs:range is used to define the data type restriction for the Range e.g. rdfs:Resource for attribute type URI. Finally rdfs:comment is used for the description. To indicate Unique Use the relation in addition becomes an owl:FunctionalProperty. The definition of a sub-property is done via the rdfs:subPropertyOf relation.

<http://doku.poolparty.biz/cocktail-ontology/primaryImage> a owl:DatatypeProperty, owl:FunctionalProperty;
  rdfs:domain <http://doku.poolparty.biz/cocktail-ontology/Cocktail>;
  rdfs:label "Primary Image"@en;
  rdfs:comment "Image to be primary used to illustrate the resource."@en
  rdfs:range rdfs:Resource;
  rdfs:subPropertyOf <http://doku.poolparty.biz/cocktail-ontology/Image>.

Available Attribute Types

This section contains an overview of attribute types available for creating custom attributes for a custom ontology.

The following table gives an overview of available attribute types and the respective data types.

Attribute Type

Description

Data Type

Example

URI

Avalid URI.

rdfs:Resource

http://www.example.com

Literal

A string that based on the defined restrictions can bewith or without a language tag.

"example1234"

Long

May only contain digits or scientific notation and must be between -9223372036854775808and+9223372036854775807

xsd:long

4,321.768 / 4.321768×103

Integer

May only contain digits and must be between -2147483648and +2147483647.

12345

Float

May only contain digits and "-". A "." is required.

xsd:float

2345.877

Date

A date selector helps with the input of this field.

xsd:date

30.09.2015

Date/Time

A date and time selector helps with the input of this field.

xsd:dateTime

20.07.2017 - 11:15

Boolean

A boolean selector lets the user select true or false.

Note: a boolean attribute is always also a owl:FunctionalProperty as it can be only assigned once to a resource.

xsd:boolean

true

Literal

The literal attribute has more configuration options and can have several characteristics based on those.

No Language option

Literal without a language tag.

23899699.png

xsd:string

"example1234"

No Restriction

Literal with or without language tag.

23899700.png

rdfs:Literal

"example1234" or "example1234"@en

Unique Per Language (No Restriction)

Literal with or without language tag that can be only there once or once per language.

23899702.png

Note

A literal with unique per language attribute is always also a swc:FunctionalLanguagePropertyas it can be only assigned once to a resource.

rdfs:Literal

"example1234" or "example1234"@en

Requires Language

Literal with language tag.

23899701.png

rdf:langString

"example1234"@en

Unique Per Language (Requires Language)

Literal with language tag that can be only there once per language.

23899703.png

Note

A literal with unique per language attribute is always also a swc:FunctionalLanguagePropertyas it can be only assigned once to a resource.

rdf:langString

"example1234"@en