User Tools

Site Tools


sw:rdf-anti-patterns

RDF and RDFS anti-patterns

rdf:type is not associative

anti-pattern: $x$ a $y$, $y$ a $z$, $x$ a $z$ .

possible cause: the “is a” relation (hyponymy) may mean “is an instance of” or “is a kind of” (subclass)

possible correction: $x$ a $y$, $y$ rdf:subClassOf $z$, $x$ a $z$ .

Wrong attachment of value characteristics

May occur when an entity has a property literal value that must be further described by a property

$x$ $p$ $y$ and $x$ $q$ $z$ instead of $x$ $p$ [:value $y$ ; $b$ $q$ $z$]

Example: a measurement value with its unit

:road1 :width 410. :road1 :unit “cm”.

should be replaced by

:road1 :width [:value 410 ; :unit “cm”]

Although the first representation is not formally wrong, it is not robust. If one wants to add a :length expressed in km, this pattern would lead to

:road1 :width 410 ; :unit “cm” ; :length 4.5 ; :unit “km”

which is clearly wrong because nothing indicates which property is related to which unit. A correct representation would be:

:road1 :width [:value 410 ; :unit “cm”] ; :length [:value 4.5 ; :unit “km”]

sw/rdf-anti-patterns.txt · Last modified: 2014/10/21 00:07 by admin