Linked Data Modeling



Triply B.V.

Naming

IRI equality

Character-for-character comparison [RFC 3987, §5.1]

IRI best practices

link

Literal components

Lexical form
Value serialization in a Unicode string.
Datatype IRI
An IRI of type rdfs:Datatype.
Language tag
Only set for datatype IRI rdf:langString. Standardized in RFC 5646 / BCP 47.

Literal equality

Defined in the value space (see semantics).

Literal best practices

Canonical form, defined through semantic reserialization.

Meaning of terms

Formal meaning

Meaning is formalized with 2 functions:

Interpretation function ($I$)
From terms (syntax) to resources and properties (semantics).
Extension function ($Ext$)
From properties (semantics) to pairs of resources (semantics).

A pair consisting of an interpretation and extension function is called a model ($M$).

Meaning of terms


  • The interpretation of a node is the resource it refers to.
  • The interpretation of a predicate term is the property it denotes.
  • The extension of a property is the collection of pairs of resources that are connected by that property.

Meaning of terms: example

Meaning of literals

For every datatype IRI $d$:

$Lex(d)$
Lexical space
$Val(d)$
Value space
$lex2val_d$
N-to-1 mapping from $Lex(d)$ to $Val(d)$.
$val2lex_d$ (canonical)
1-to-1 mapping from $Val(d)$ to $Lex(d)$.

Syntactic normalization of literals

Literal "abc"^^:d

$val2lex_{\texttt{:d}}(lex2val_{\texttt{:d}}(\texttt{"abc"}))$

Meaning of sentences

Meaning of sentences: Truth-conditional Semantics

To understand what a sentence means is to know what is the case if it would be true. (One can understand a sentence, without knowing whether it is true.)
Tractatus Logico-Philosophicus, 4.024

Truth of a triple

$$\langle s,p,o \rangle \text{ is true} \iff \langle I(s),I(o) \rangle \in Ext(I(p))$$


$$\langle \text{the Louvre}, \text{owns}, \text{the Mona Lisa} \rangle \text{ is true} \iff$$ $$\langle I(\text{the Louvre}), I(\text{the Mona Lisa}) \rangle \in Ext(I(\text{owns})) \iff$$ $$\langle 🏰, 🖼 \rangle \in Ext(\text{concept-of-ownership}) \iff$$ $$\langle 🏰, 🖼 \rangle \in \{ \langle 🏰, 🖼 \rangle, \langle 👱, 🚗 \rangle \}$$ ✓

Falsity of a triple

$$\langle s,p,o \rangle \text{ is true} \iff \langle I(s),I(o) \rangle \in Ext(I(p))$$


$$\langle \text{the Mona Lisa}, \text{owns}, \text{the Louvre} \rangle \text{ is true} \iff$$ $$\langle I(\text{the Mona Lisa}), I(\text{the Louvre}) \rangle \in Ext(I(\text{owns})) \iff$$ $$\langle 🖼, 🏰 \rangle \in Ext(\text{concept-of-ownership}) \iff$$ $$\langle 🖼, 🏰 \rangle \in \{ \langle 🏰, 🖼 \rangle, \langle 👱, 🚗 \rangle \}$$ ❌

Meaning of a triple

The meaning of a triple is the set of models in which the triple is true.

Meaning of a graph

The meaning of a graph is the set of models in which all triples in the graph are true.

Open World Assumption
&
Closed World Assumption

Difference between OWA and CWA

Database
“Apples are green.”
Question
“Are apples delicious?”
CWA answer
“No.”
OWA answer
“I don't known.”

Why does the SW need OWA?

In a local database, we can assume that we always have full access to all the relevant data.

On the web, we may not always have access to all relevant data all of the time.

Example of OWA

  • I(the Louvre) = 🏰
  • I(the Mona Lisa) = 🖼
  • Ext(I(owns)) = {〈 🏰,🖼〉}
  • Ext(I(exhibits)) = {〈 🏰,🖼〉}

With CWA, owning and exhibiting would have the same meaning. With OWA, they may still be different.

  • I(owns) = concept-of-ownership
  • I(exhibits) = concept-of-exhibiting

OWA requires models to consist of 2 functions

Intension function (I)
Mapping RDF terms to resources.
Extension function (Ext)
Mapping properties to extensions. (Properties are resources.)

Corner cases (1/2)


                  rdfs:Class a rdfs:Class.
              
  • I(rdfs:Class) = 🐕
  • I(a) = 🐘
  • Ext(🐘) = {〈🐕,🐕〉, …}

This statement cannot be expressed with CWA, due to the axiom of regularity: $(\forall x)(x \neq \emptyset \rightarrow (\exists y \in x)(x \cap y = \emptyset))$

Corner cases (2/2)


                  owl:sameAs owl:sameAs owl:sameAs.
              
  • I(owl:sameAs) = ~
  • Ext(~) = {〈~,~〉, …}

$\langle \texttt{owl:sameAs}, \texttt{owl:sameAs}, \texttt{owl:sameAs} \rangle \,\text{is true}\\iff\\ \langle I(\texttt{owl:sameAs}), I(\texttt{owl:sameAs}) \rangle \in Ext(I(\texttt{owl:sameAs}))$

Notice that an RDF graph is a special kind of graph, i.e., vertices and edges may overlap.

Instance & class

Classes: rdf:Property, rdfs:Class, rdfs:Datatype, rdfs:Resource

Properties: rdf:type (a)

Instances belong to classes


                    pokemon:pikachu a def:Pokemon;
                      def:knows pokemon:mew;
                      def:name "ピカチュウ"@ja;
                      def:weight 60.

                    pokemon:mew a def:Pokemon;
                      def:name "ミュウ"@ja;
                      def:weight 40.
                

Derivations


                "…"^^:d.
                ⊧ "…"^^:d a :d. # If lex2val_d("…") ∈ val(d)
            

                :s :p :o.
                ⊧ :p a rdf:Property.
            

                :s :p "…"^^:d.
                ⊧ :d a rdfs:Datatype.
            

                :s :p :o.
                ⊧ :s a rdfs:Resource.
            

                :s :p :o.
                ⊧ :o a rdfs:Resource.
            

                :i a :c.
                :c rdfs:subClassOf :d.
                ⊧ :i a :d.
            

Multiple inheritance

Due to OWA, an instance can belong to classes that are not subclass/superclass of one other (see later).

Therefore, instances cannot be displayed in a tree.

Class hierarchy

Properties: rdfs:subClassOf

Derivations


                :c a rdfs:Class.
                ⊧ :c rdfs:subClassOf rdfs:Resource.
            

                :c a rdfs:Class.
                ⊧ :c rdfs:subClassOf :c.
            

                :c rdfs:subClassOf :d.
                :d rdfs:subClassOf :e.
                ⊧ :c rdfs:subClassOf :e.
            

                :d a rdfs:Datatype.
                ⊧ :d rdfs:subClassOf rdfs:Literal.
            

Property hierarchy

rdfs:subPropertyOf

When to use?

  • Model a sub-relation of a super-relation
  • Semantic variants of the same relation.

Derivation rules


                :p rdfs:subPropertyOf :q.
                :q rdfs:subPropertyOf :r.
                ⊧
                :p rdfs:subPropertyOf :r.
            

                :p a rdf:Property.
                ⊧
                :p rdfs:subPropertyOf :p.
            

                :p rdfs:subPropertyOf :q.
                :s :p :o.
                ⊧
                :s :q :o.
            

Model a sub-relation of a super-relation

Definition


                :child rdfs:subPropertyOf :relative.
                :daughter rdfs:subPropertyOf :child.
                :son rdfs:subPropertyOf :child.

                :parent rdfs:subPropertyOf :relative.
                :father rdfs:subPropertyOf :parent.
                :mother rdfs:subPropertyOf :parent.
            

Derivation


                :daughter rdfs:subPropertyOf :relative.
                :son rdfs:subPropertyOf :relative.

                :father rdfs:subPropertyOf :relative.
                :mother rdfs:subPropertyOf :relative.
            

Semantic variants of the same relation

Definition


                :partOf rdfs:subPropertyOf :partOfTransitive.
                :partOfTransitive a owl:TransitiveProperty.
            

Assertion


                :pikachusTail :partOf :pikachu.
                :pikachu :partOf :electricType.
            

Derivation


                :pikachusTail :partOfTransitive :pikachu.
                :pikachu :partOfTransitive :electricType.

                :pikachusTail :partOfTransitive :electricType.
            

Domain & range

Properties: rdfs:domain, rdfs:range

When to use?

  • For every property definition.

Often used incorrectly



                  bpo:has_event
                    rdfs:domain
                      bpo:disease,
                      bpo:event,
                      bpo:person.
              
Examples from BioPortal (bpo).

Derivations


                :p rdfs:domain :c.
                :s :p :o.
                ⊧ :s a :c.
            

                :p rdfs:range :c.
                :s :p :o.
                ⊧ :o a :c.
            

Schema derivation is not possible


                :a :son :b.
                :son rdfs:subPropertyOf :child.
                :child rdfs:domain :Person.
                ⊧ :a :child :b.
                ⊧ :a a :Person.
            

The following cannot be derived…


                :son rdfs:domain :Person.
            

Containers & Collections

Classes: rdf:Alt, rdf:Bag, rdfs:ContainerMembershipProperty, rdf:List, rdf:Seq

Properties: rdf:first, rdf:nil, rdf:rest, rdfs:member, rdf:_1, …

When to use?

Containers
rdf:Alt
Default value + alternatives
rdf:Bag
Unordered & open
rdf:Seq
Ordered & open
Collections
rdf:List
Ordered & closed

Containers

For every positive integer ‘N’ there is a corresponding container membership property rdf:_N such that:


                rdf:_N rdfs:subPropertyOf rdfs:member.
            

Used to relate members to containers:


                :container rdf:_N :member.
            

RDF list

Abbreviated syntax in N3, Turtle and TriG.


                [ a sdo:ScholarlyArticle;
                  bibo:authorList (:a :b :c) ].
            

                [ a sdo:ScholarlyArticle;
                  bibo:authorList
                    [ rdf:first :a;
                      rdf:rest
                        [ rdf:first :b;
                          rdf:rest
                            [ rdf:first :c;
                              rdf:rest rdf:nil ] ] ] ].
            

Derivation


                :p a rdfs:ContainerMembershipProperty.
                ⊧ :p rdfs:subPropertyOf rdfs:member.
            

Unit of measure

Unit of measure (❌)


                    pokemon:abomasnow
                      def:length 22;
                      def:weight 1355.
                

Length in meters, feet, other? Weight in pounds, kilos, other?

Unit of measure (✓)


                    pokemon:abomasnow
                      def:length
                        [ def:unit dbd:meter;
                          rdf:value 2.2 ];
                      def:weight
                        [ def:unit dbd:kilogram;
                          rdf:value 135.5 ].
                

Intermediate node + rdf:value.

Unit of measure (✓)


                    pokemon:abomasnow
                      def:length "2.2"^^dbd:meter;
                      def:weight "135.5"^^dbd:kilogram.
                

Datatype IRI

Dataset

Dataset

A collection of named graphs.

Dataset description


                  graph:Mimi {
                    id:Mimi
                      vocab:name "ਮੀਮੀ ਹੈਮਿੰਕ ਚਮਚਾ"@pa;
                      vocab:birthYear "1839"^^xsd:gYear .
                  }

                  graph:Multatuli {
                    id:Multatuli
                      foaf:knows id:Mimi;
                      vocab:name "ਮੁਲਤਾਤੁਲੀ"@pa;
                      vocab:birthYear "1820"^^xsd:gYear.
                  }

                  [ a void:Dataset;
                    dct:subject dbr:Literature;
                    void:subset
                      graph:Mimi,
                      graph:Multatuli ].
              

WIP: Events

Event example

Eduard Douwes Dekker worked at the Dutch East Indies throughout 1840.

Event (❌)


                  :Eduard :worksAt :East_Indies;
                  :begin "1840-01-01"^^xsd:date;
                  :end "1840-12-31"^^xsd:date.
              

Event (✓)


                    :Eduard :worksAt :East_Indies.
                    :event
                      rdf:subject :Eduard;
                      rdf:predicate :worksAt;
                      rdf:object :East_Indies;
                    :begin "1840-01-01"^^xsd:date;
                    :end "1840-12-31"^^xsd:date.
                

RDF reification vocabulary

Event + uncertainty (✓)


                    :Eduard :worksAt :East_Indies.
                    :event
                      rdf:subject   :Eduard;
                      rdf:predicate :worksAt;
                      rdf:object    :East_Indies;
                      time:hasBeginning [
                        time:inXSDDate "1840-01-01"^^xsd:date;
                        time:unitType  time:unitWeek ];
                      time:hasEnd [
                        time:inXSDDate "1840-12-31"^^xsd:date;
                        time:unitType  time:unitWeek ].
                

http://www.w3.org/2006/time# (Time Ontology in OWL)

Linked Data Modeling



Triply B.V.