Skip to content

RDF‐star examples of profiles

Enrico Franconi edited this page May 31, 2024 · 26 revisions

RDF-star examples (DRAFT 2024.05.31)

In a concrete syntax (Turtle, in this document) there is the need to specify whether a reifier macro refers to a transparent triple or to an opaque triple. Here, we write a triple term within quotes to specify a reifier referring to an opaque triple, and a triple term without quotes to specify a reifier referring to a transparent triple. We assume RDF semantics.

1. Example of opaque triples (encoding and extending a Neo4j LPG)

PREFIX schema: <https://schema.org/>
PREFIX fraud: <http://example.org/ns/fraud/>
PREFIX : <http://example.org/ns/>

# Model
fraud:Account rdfs:subClassOf schema:StructuredValue .
fraud:transfer rdfs:domain fraud:Account ; rdfs:range fraud:Account .
fraud:amount rdfs:domain fraud:Transaction ; rdfs:range xsd:integer .
fraud:registered-at rdfs:domain fraud:Transaction ; rdfs:range schema:Dataset .
fraud:owner rdfs:domain fraud:Account ; rdfs:range schema:Person .

# Data
<< :e1 | ':account-123 fraud:transfer :account-456' >> a fraud:Transaction ;
    fraud:amount 10000 ;
    schema:datePosted "2002-09-24Z"^^xsd:date ;
    fraud:registered-at <http://wikileaks.org/banking:panama-database> .

<< :e2 | ':account-123 fraud:transfer :account-456' >> a fraud:Transaction ;
    rdfs:comment "Transaction not reliable due to contradictory data" ;
    schema:datePosted "2002-10-11Z"^^xsd:date .

:account-123 fraud:owner :john .

:account-456 fraud:owner :mary ;
    fraud:isBlocked true .

2. Example of transparent triples

<< _:w1 | :liz :married _:h >> a :Marriage ; :starts 1964 .
<< _:w2 | :liz :married _:h >> a :Marriage ; :starts 1975 .

_:h owl:sameAs :richard .

<< _:w1 | :liz :married :richard >> a :Marriage ; :starts 1964 .
<< _:w1 | :richard :married :liz >> a :Marriage ; :ends 1974 .

3. Example of opaque triples

_:x owl:sameAs _:y , :richard .

<< _:t1 | ':liz :married _:x' >> a rdf:TripleToken ;
    :in-graph <http://example.com/weddings> ;
    :stored-by :mary ;
    :on-date "2020-03-12Z"^^xsd:date ;
    rdfs:seeAlso <https://lasvegasnevada.gov/resource/t1> .

<< _:t2 | ':liz :married _:y' >> a rdf:TripleToken ;
    :in-graph <http://example.com/weddings> ;
    :stored-by :paul ;
    :on-date "2020-03-13Z"^^xsd:date .

4. Why example 3 needs opaque triples?

_:x owl:sameAs _:y , :richard .

<< _:t1 | :liz :married _:x >>
    :in-graph <http://example.com/weddings> ;
    :stored-by :mary ;
    :on-date "2020-03-12Z"^^xsd:date ;
    rdfs:seeAlso <https://lasvegasnevada.gov/resource/t1> .

<< _:t2 | :liz :married _:y >>
    :in-graph <http://example.com/weddings> ;
    :stored-by :paul ;
    :on-date "2020-03-13Z"^^xsd:date .

⊨ << _:t1 | :liz :married :richard >> :stored-by :mary ; :stored-by :paul .

5. Example of transparent triples (for data integration)

# graph 1
<< :w1 | :liz :married _:h >> a :Marriage ; :starts 1964.
<< :w2 | :liz :married _:h >> a :Marriage ; :starts 1975.
_:h owl:sameAs :richard .
<< :w1 | :richard :married :liz >> a :Marriage ; :ends 1974 .

# graph 2
<< :w2 | :richard :married-in :las-vegas >> :best-man :jim-benton .
<< :w2 | :liz :married-on 1975 >> :location :las-vegas .
:w2 :groom :richard .
:w2 :bride :liz .

6. Example of transparent triples

<< _:w3 | :bill-clinton :related-to :hillary-rodham >> :starts 1975 .
<< _:w3 | :42nd-potus :husband :1st-female-NY-senator >> :starts 1975 .

7. Example of mixed opaque and transparent triples

PREFIX lvn: <https://lasvegasnevada.gov/resource/>

<< lvn:t1 | ':liz :married :richard' >> a :TripleToken .
lvn:t1 :added-in lvn:rdf-registry ; :stored-by :john .
lvn:t1 :on-date "2006-03-12Z"^^xsd:date .
lvn:t1 :provenance lvn:database-1975-123973q2 .

<< lvn:c1 | :liz :married :richard >> a lvn:WeddingCertificate .
lvn:c1 lvn:wedding-starts 1975 .

<< lvn:c2 | :liz :married :richard >> a lvn:WeddingCertificate .
lvn:c2 lvn:wedding-starts 1964 .

<< lvn:c3 | :liz :married :richard >> a lvn:WeddingCertificate .
lvn:c3 lvn:wedding-starts 1971 .

lvn:c1 :printed-on "2020-10-11Z"^^xsd:date .
lvn:c2 :printed-on "2021-03-12Z"^^xsd:date .
lvn:c3 :printed-on "2021-03-12Z"^^xsd:date .

8. Examples of transparent triples (for statements about statements)

<< _:s1 | :paul :loves :mary >> a :Fact ; :uttered-by :john .
<< _:s2 | :paul :loves :mary >> a :Fact ; :confuted-by :paul .

:john :believes
      << _:s1 | << [] | :liz :spouse :richard >>
                  :starts 1964 >> .
:s1 :certified-by :us-census .

:paul :believes
  << _:s2 | << [] | :liz :spouse :richard >>
            :starts 1955 >> .

9. Why opaque triples do not work for data integration (P.-A. Champin)

a. Alice publishes the following graph as <alice.ttl>

    <#w1> rdf:annotationOf <<( :liz : married :richard )>> .
    <#w1> :year 1964 .
    <#w2> rdf:annotationOf <<( :liz : married :richard )>> .
    <#w2> :year 1975 .

b. Bob publishes the following graph as <bob.ttl>

    <#w64> rdf:annotationOf <<( :liz :married-in 1964 )>> .
    <#w64> :groom :richard .

c. Charlie notices that Alice and Bob are talking about the same wedding, and states

    <alice.ttl#w1> owl:sameAs <bob.ttl#w64>.

From there, Charlie infers that

    <<( :liz : married :richard )>> owl:sameAs <<( :liz :married-in 1964 )>>.
    <alice.ttl#w1> rdf:annotationOf <<(:liz :married-in 1964 )>> ; :year 1975.

10. Entailments

    << :e | :s1 :p1 :o1 >> :p :o .
entails
    << :e | :s1 :p1 _:x >> :p :o .

    << :e | ':s1 :p1 :o1' >> :p :o .
does not entail
    << :e | ':s1 :p1 _:x' >> :p :o .
Clone this wiki locally