Skip to content

How is OWL translated into a labeled property graph?

Fritz Lekschas edited this page Sep 2, 2015 · 6 revisions

HomeWikiAboutHow is OWL translated into a labeled property graph?


Translation

Classes

URI-based classes are translated into a node, labeled with the string Class and the ontology abbreviation or prefix. The node stores two mandatory properties _name and uri. The name corresponds to the class's local name prefixed with the ontology's abbreviation. For OWL the local name ideally refers to the string followed after the hash character #. For OWL-translated OBO ontologies the local name refers to local ID and the ID space is used as the prefix [Ref][oboIdPolicy]. The uri simply stores the class's uri and is used as a unique identifier.

Example:

OWL:

http://www.w3.org/2002/07/owl#Thing
http://purl.obolibrary.org/obo/BTO_0002295

Neo4J:

(Class:owl {name: 'owl:Thing', uri: 'http://www.w3.org/2002/07/owl#Thing'})
(Class:bto {name: 'bto:0002295', uri: 'http://purl.obolibrary.org/obo/BTO_0002295'})

Object Properties

Object properties describe the relationship between two individuals of some classes. Thinking of graphs object properties describe the connectivity and thus are translated into a relationship between two nodes. The relationship's name follows node's name schema, hence being the local name prefixed with the ontology's abbreviation or prefix.

Example:

OWL:

http://toast.brot/belag#Wurst http://www.w3.org/2000/01/rdf-schema#subClassOf http://www.w3.org/2002/07/owl#Thing
```

Neo4J:

```
(belag:Wurst) -[`rdfs:subClassOf`]-> (owl:Thing)
```

#### Data Properties

Data properties associate literals to a class. In Neo4J we add data properties as properties of nodes.

**Example:**

OWL:

```
http://toast.brot/belag#Wurst http://www.w3.org/2000/01/rdf-schema#label 'Wurst'
```

Neo4J:

```
(belag:Wurst {`rdfs:label`:'Wurst'})
```

#### Individuals

What about individuals? As of this writing _Owl2Neo4J_ doesn't support individuals. The rational is that individual represent kind of end points in an ontology. I.e. if we have a class of _countries_ an individual could be _Germany_ or the _United States of America_. While individuals make sense in some contexts, they are rarely or almost not used in bio-ontologies as they are not extensible and extensibility is an important property of most concepts in bioscience. Even though some concepts might seem to have proven to truly represent reality, no one can known for sure. Thus, utilising classes instead of individuals provides more freedom for later adjustments.

#### Meta data

**Ontology node:**

In order to be able to store certain meta data related to ontologies like the version, download location, format etc., the tool creates an extra node labelled with _Ontology_. Each nodes holds the four properties:

- name _(Arbitrary name to identify )_
- uri _(URI of the ontology)_
- rdfs:label _(Full name of the ontology)_
- acronym _(Usually the commonly known prefix)_

# Constraints

A number of constraints are applied in order to keep the data consistent and clean. Note that all unique properties are indexed as well.

**Nodes:**

- Class.name is indexed
- Class.uri must be unique
- Ontology.name must be unique
- Ontology.uri must be unique

**Relationships (Edges):**

- Relationship types are by default unique

**Properties:**

- Property keys are by default unique

[oboIdPolicy]: http://www.obofoundry.org/id-policy.shtml