36
Supplementary Material: Non-binary relations in RDF Wiltrud Kessler Institut f¨ ur Maschinelle Sprachverarbeitung Universit¨ at Stuttgart Semantic Web This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. http://creativecommons.org/licenses/by-nc-sa/3.0/

Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Supplementary Material:Non-binary relations in RDF

Wiltrud Kessler

Institut fur Maschinelle SprachverarbeitungUniversitat Stuttgart

Semantic Web

This work is licensed under a Creative CommonsAttribution-NonCommercial-ShareAlike 3.0 Unported License.http://creativecommons.org/licenses/by-nc-sa/3.0/

Page 2: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

The Semantic Web Stack [W3C, Tim Berners-Lee]

URI Unicode, UTF-8

XML, XMLSchema, Namespaces

RDF

SPARQLRDFS

Ontology, OWL

Logic, Rules

Proof

En

cryp

tion

Dig

ital

Sig

nat

ure

s

Trust

User Interface, Software Agents

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 2 / 36

Page 3: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Outline

Why Empty Nodes

Alternative Representations

Examples with Empty Nodes

Examples without Empty Nodes

Empty Nodes and Semantics

References

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 3 / 36

Page 4: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Outline

Why Empty Nodes

Alternative Representations

Examples with Empty Nodes

Examples without Empty Nodes

Empty Nodes and Semantics

References

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 4 / 36

Page 5: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

What are Empty Nodes?

I N-ary relations (relations with more than one object) cannotbe expressed directly in RDF.

I An (empty) helper node has to be introduced.

I Example: “John plays the violin in the orchestra OUS”.

ex:JohnSmith

ex:Violin

ex:OUS

ex:playsex:instrument

ex:orchestra

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 5 / 36

Page 6: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Avoiding Problems 1

“John plays the violin in the orchestra OUS” and“John plays the cello in the orchestra OO”

ex:JohnSmith

ex:Violin

ex:OUS

ex:Cello

ex:OO

ex:playsex:instrument

ex:orchestra

ex:playsex:instrument

ex:orchestra

We can easily distinguish what is played where.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 6 / 36

Page 7: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Avoiding Problems 2

“John plays the violin in the orchestra OUS” and“A.N. Other plays the violin in the orchestra OO”

ex:JohnSmith

ex:Violin

ex:OUS

ex:ANOther

ex:OO

ex:plays

ex:instrument

ex:orchestra

ex:plays

ex:instrument

ex:orchestra

We can easily distinguish who plays what where.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 7 / 36

Page 8: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

We can add arbitrary many arguments

ex:JohnSmith

ex:Violin

ex:OUS

2012-02-15ˆˆxs:date

. . .

ex:plays

ex:instrument

ex:orchestra

ex:startDate

. . .

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 8 / 36

Page 9: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

When do we need to use empty nodes?

I A binary relation has additional properties(e.g., text A is about the topic B with probability P).

I Different aspects of the same relation need to be modeled(e.g., Steve has a temperature, which is high, but falling).

I More than two entities are linked by a relation(e.g., John buys book A from store B for $15).

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 9 / 36

Page 10: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

When do we NOT need to use empty nodes?

I There seems to be one relation, but there are in fact several(e.g., book A is written by persons X and Y).

I A binary relation has additional properties, but theseproperties can be retrieved from the individual relations or areirrelevant for the domain and application(e.g., Fred is one of three sons of Molly)

I More than two entities are linked by a relation, but therelation is guaranteed to occur only once(e.g., Paul was born in X on date D)

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 10 / 36

Page 11: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Tests for empty nodes

Tests to check whether we need to introduce an empty node for arelation in our domain:

I Can I get meaningful statements when separating theindividual parts (for all of them)?

I What happens if an instance has more than one of therelation, can I still distinguish what belongs together?

I Do I need this level of detail for the information for mydomain and application?

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 11 / 36

Page 12: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Outline

Why Empty Nodes

Alternative Representations

Examples with Empty Nodes

Examples without Empty Nodes

Empty Nodes and Semantics

References

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 12 / 36

Page 13: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Alternative Representations

I Empty nodes create problems in some applications and whenRDFS or OWL should be used.

I We can represent the relation as a class rather than a property.

I Create a new class to represent the concept of the relation.I Use an instance of this class to either

A directly replace the empty node, orB be the subject in a list of statements where all participants in

the relation are objects.

I Depending on the relation, using alternative A or B may bemore intuitive.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 13 / 36

Page 14: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Reviews – with Empty Node

Andy writes a five-star review about movie X on 2015-11-04containing the text “Awesome!”.

ex:Andy

ex:FiveStars

“Awesome!”

ex:MovieX

2015-11-04

ex:writesReview

ex:hasReviewStars

ex:hasReviewText

ex:hasReviewMovie

ex:hasReviewDate

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 14 / 36

Page 15: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Reviews – Alternative A

Andy writes a five-star review about movie X on 2015-11-04containing the text “Awesome!”.

ex:Andy ex:Review12345

ex:FiveStars

“Awesome!”

ex:MovieX

2015-11-04

ex:writesReview

ex:hasReviewStars

ex:hasReviewText

ex:hasReviewMovie

ex:hasReviewDate

ex:Review12345 is an instance of the new class ex:Review thatrepresents the concept of an online movie review.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 15 / 36

Page 16: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Reviews – Alternative B

Andy writes a five-star review about movie X on 2015-11-04containing the text “Awesome!”.

ex:Review12345

ex:Andy

ex:FiveStars

“Awesome!”

ex:MovieX

2015-11-04

ex:hasReviewAuthor

ex:hasReviewStars

ex:hasReviewText

ex:hasReviewMovie

ex:hasReviewDate

ex:Review12345 is an instance of the new class ex:Review thatrepresents the concept of an online movie review.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 16 / 36

Page 17: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Outline

Why Empty Nodes

Alternative Representations

Examples with Empty Nodes

Examples without Empty Nodes

Empty Nodes and Semantics

References

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 17 / 36

Page 18: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Classification [W3C]

Text A is about the topic “China” with probability 0.9 according toclassifier X.

ex:TextA

ex:China

ex:ClassifierX

0.9

ex:hasTopicClassification

ex:hasTopic

ex:hasBeenClassifiedBy

ex:hasClassProbablity

We could separate “Text A is about China”, but no otherseparation possible, especially if we allow multiple classificationresults by different classifiers with different probabilities.(“A classified by X” ?? “A has probability 0.9” ??)

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 18 / 36

Page 19: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Temparature [W3C]

Steve has temperature, which is high, but falling.

ex:Steve

ex:High

ex:Falling

ex:hasTemparature

ex:hasTempValue

ex:hasTempTrend

We could separate into two statements “Steve has hightemparature” and “Steve has temparature which is falling”, butthe two are linked and we loose the connection if we store themseparately, especially when several measurements are taken.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 19 / 36

Page 20: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Temparature [W3C] – Alternative A

Steve has temperature, which is high, but falling.

ex:Steve ex:Observation12345

ex:High

ex:Falling

ex:hasTemparature

ex:hasTempValue

ex:hasTempTrend

ex:Observation12345 is an instance of the new classex:TemperatureObservation that represents the concept of anobservation of a person’s temparature.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 20 / 36

Page 21: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Purchases [W3C]

John buys a ”Lenny the Lion” book from books.example.com for$15 as a birthday gift

ex:John

ex:LennyTheLion

ex:books.example.com

$15

ex:BirthdayGift

ex:buys

ex:hasObject

ex:hasSeller

ex:hasAmount

ex:hasPurpose

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 21 / 36

Page 22: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Purchases [W3C] – Alternative B

John buys a ”Lenny the Lion” book from books.example.com for$15 as a birthday gift.

ex:Purchase12345

ex:John

ex:LennyTheLion

ex:books.example.com

$15

ex:BirthdayGift

ex:hasBuyer

ex:hasObject

ex:hasSeller

ex:hasAmount

ex:hasPurpose

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 22 / 36

Page 23: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Giving

Alice gives the book “The Truth about the Semantic Web”(ex:SWTruth) to Bob?

ex:Alice

ex:Bob

ex:SWTruth

ex:gives

ex:recipient

ex:item

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 23 / 36

Page 24: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Mango Chutney [HKRS08, HKR09]

Mango Chutney contains 450 gram of green Mango.

ex:MangoChutney

ex:GreenMango

“450 gram”

ex:hasIngredient

ex:ingredient

ex:amount

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 24 / 36

Page 25: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Mango Chutney [HKRS08, HKR09]

Mango Chutney contains 450 gram of green Mango.

ex:MangoChutney

ex:GreenMango

450

ex:Gram

ex:hasIngredient

ex:hasFoodItem

ex:hasAmount

ex:hasUnit

We can add arbitrary many arguments to the relation.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 25 / 36

Page 26: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Tennis

Steffi Graf won Wimbledon in 1995 and French Open in 1996.

ex:SteffiGraf

ex:Wimbledon

1995

ex:FrenchOpen

1996

ex:won

ex:event

ex:year

ex:won

ex:event

ex:year

We can easily know which event she won in which year,

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 26 / 36

Page 27: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Outline

Why Empty Nodes

Alternative Representations

Examples with Empty Nodes

Examples without Empty Nodes

Empty Nodes and Semantics

References

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 27 / 36

Page 28: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Children

Molly has three sons, Ron, Fred and George?

ex:Molly ex:Ron

ex:Fred

ex:George

ex:hasSon

ex:hasSon

ex:hasSon

Objects are independent of each other, separation possible: “Mollyhas son Ron”, “Molly has son Fred”, “Molly has son George”. Wecan get the information about the number of sons by counting howmany “has son” relations Molly has with other resources.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 28 / 36

Page 29: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Authors

The book “Foundations of Semantic Web Technologies”(SWFoundations) is written by Pascal Hitzler, Markus Krotzsch andSebastian Rudolph.

ex:SWFoundations ex:Hitzler

ex:Krotzsch

ex:Rudolph

ex:hasAuthor

ex:hasAuthor

ex:hasAuthor

Objects are independent of each other, separation possible:“Hitzler is author of SWFoundations”, . . .

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 29 / 36

Page 30: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Example: Birth place and date

Johann Wolfgang von Goethe was born on August 28th, 1749 inFrankfurt/Main.

ex:Goethe

ex:FrankfurtAmMain

1749-08-28

ex:hasPlaceOfBirth

ex:hasDateOfBirth

Even though the two things belong together, each one hasmeaningful information on its own and there can never be tworelations of this type, so we don’t need to introduce an emptynode.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 30 / 36

Page 31: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Outline

Why Empty Nodes

Alternative Representations

Examples with Empty Nodes

Examples without Empty Nodes

Empty Nodes and Semantics

References

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 31 / 36

Page 32: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Semantics

ex:Pizza1234

ex:Euro

7.50

ex:hasPrice

ex:hasCurrency

ex:hasAmount

I Defining domain and range of the properties is problematic:I What is the range of ex:hasPrice?I What is the domain of ex:hasCurrency and ex:hasAmount?

I We also would like to make sure that there can only be oneamount and currency.

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 32 / 36

Page 33: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Semantics in RDFS (Domain and Range)

ex:Pizza1234 ex:PriceExpression12334

es:Euro

7.50

ex:hasPrice

ex:hasCurrency

ex:hasAmount

Introduce new class ex:PriceExpression:

ex:hasPrice Domain: ex:Pizza

Range: ex:PriceExpression

ex:hasCurrency Domain: ex:PriceExpression

Range: ex:Currency

ex:hasAmount Domain: ex:PriceExpression

Range: xs:Float

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 33 / 36

Page 34: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Semantics in OWL (Restrictions)

I Every instance of ex:PriceExpression can have only oneamount and one currency:make ex:hasCurrency and ex:hasAmount functional.

I Make sure there is a value for currency:create a restriction on ex:PriceExpression

owl:onProperty ex:hasCurrency

owl:someValueFrom ex:Currency

I Make sure there is a value for the amount:create a restriction on ex:PriceExpression

owl:onProperty ex:hasAmount

owl:someValueFrom xs:float

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 34 / 36

Page 35: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Outline

Why Empty Nodes

Alternative Representations

Examples with Empty Nodes

Examples without Empty Nodes

Empty Nodes and Semantics

References

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 35 / 36

Page 36: Supplementary Material: Non-binary relations in RDF · WhyAlternativesExamples YesExamples NoSemanticsReferences When do we NOT need to use empty nodes? I There seems to be one relation,

Why Alternatives Examples Yes Examples No Semantics References

Suggested Reading

[HKRS08] Pascal Hitzler, Markus Krotzsch, Sebastian Rudolphand York Sure. Semantic Web. Grundlagen. Springertextbook, 2008. (Chapter 3)

[HKR09] Pascal Hitzler, Markus Krotzsch and Sebastian Rudolph.Foundations of Semantic Web Technologies. Chapman &Hall/CRC, 2009. (Chapter 2)

[W3C] W3C Working Group. Defining N-ary Relations on theSemantic Web. 2009.http://www.w3.org/TR/swbp-n-aryRelations/

Wiltrud Kessler Supplementary Material: Non-binary relations in RDF 36 / 36