-
-
Save jaw111/2c550fb7c77fbcf154a310b29ecb156c to your computer and use it in GitHub Desktop.
RDF-star "ocurrence" pattern vs. Schema.org "role" pattern vs. PROV-O "qualification" pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@prefix s: <http://schema.org/>. | |
@prefix prov: <http://www.w3.org/ns/prov#>. | |
# simple (unqualified) statement | |
:dr_strangelove a s:Movie ; | |
s:actor :peter_sellers. | |
# RDF-star with "ocurrence" nodes | |
## Quoted triple syntax | |
:dr_strangelove a s:Movie ; | |
s:actor :peter_sellers. | |
<< :dr_strangelove s:actor :peter_sellers >> | |
s:withPerformanceRole [ | |
s:characterName "Group captain Lionel Mandrake" | |
], [ | |
s:characterName "Dr Strangelove" | |
] | |
## Annotation syntax | |
:dr_strangelove a s:Movie ; | |
s:actor :peter_sellers {| | |
s:withPerformanceRole [ | |
s:characterName "Group captain Lionel Mandrake" | |
], [ | |
s:characterName "Dr Strangelove" | |
] | |
|}. | |
## NB: the original triple (:dr_strangelove s:actor :peter_sellers) | |
## is still in the graph, | |
## so queries like ':dr_strangelove s:actor ?a' still work | |
# Schema.org "role" pattern | |
:dr_strangelove a s:Movie ; | |
s:actor [ | |
a s:PerfomanceRole ; | |
s:characterName "Group captain Lionel Mandrake" ; | |
s:actor :peter_sellers ; | |
], [ | |
a s:PerfomanceRole ; | |
s:characterName "Dr Strangelove" ; | |
s:actor :peter_sellers ; | |
]. | |
## NB: the original triple (:dr_strangelove s:actor :peter_sellers) | |
## is not in the graph anymore, so queries need to be changed. | |
## Furthermore, queries like ':dr_strangelove s:actor ?a' | |
## may now return a mix of Actors and PerformanceRoles | |
## (because some s:actor relations may still be in simple form). | |
# PROV-O qualification pattern | |
:dr_strangelove a s:Movie ; | |
s:actor :peter_sellers ; # simple unqualified statement can be asserted | |
prov:qualifiedAssociation [ | |
a s:PerfomanceRole ; | |
s:characterName "Group captain Lionel Mandrake" ; | |
prov:agent :peter_sellers ; | |
], [ | |
a s:PerfomanceRole ; | |
s:characterName "Dr Strangelove" ; | |
prov:agent :peter_sellers ; | |
]. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment