Skip to content

Instantly share code, notes, and snippets.

@ruebot
Created August 23, 2016 19:18
Show Gist options
  • Save ruebot/348ed28d49e1493f9f72c5f8658e1bcc to your computer and use it in GitHub Desktop.
Save ruebot/348ed28d49e1493f9f72c5f8658e1bcc to your computer and use it in GitHub Desktop.
-- convert ORE to PCDM 2.0 --
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX ore: <http://www.openarchives.org/ore/terms/>
PREFIX pcdm: <http://pcdm.org/models#>
CONSTRUCT {
?obj a pcdm:Object ;
iana:first ?first ;
iana:last ?last ;
pcdm:hasMember ?page .
?page a pcdm:Object ;
iana:prev ?prev ;
iana:next ?next ;
pcdm:hasFileSet ?fs .
?fs a pcdm:FileSet ;
pcdm:hasFile ?file .
?file a pcdm:File . }
WHERE {
<http://localhost:8080/fcrepo/rest/resourceMaps/1> ore:describes ?obj .
?obj a ore:Aggregation ; ore:aggregates ?page .
?page a ore:Aggregation ; ore:aggregates ?fs .
?fs a ore:Aggregation ; ore:aggregates ?file .
?file a ldp:NonRdfSource .
OPTIONAL {
?obj iana:first ?first .
}
OPTIONAL {
?obj iana:last ?last .
}
OPTIONAL {
?page iana:prev ?prev .
}
OPTIONAL {
?page iana:next ?next .
}
}
-- convert ORE to PCDM 1.0 --
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX ore: <http://www.openarchives.org/ore/terms/>
PREFIX pcdm: <http://pcdm.org/models#>
CONSTRUCT {
?obj a pcdm:Object ;
pcdm:hasMember ?page .
?page a pcdm:Object ;
pcdm:hasFile ?file .
?file a pcdm:File . }
WHERE {
<http://localhost:8080/fcrepo/rest/resourceMaps/1> ore:describes ?obj .
?obj a ore:Aggregation ;
ore:aggregates ?page .
?page a ore:Aggregation ;
ore:aggregates ?file .
?file a ldp:NonRdfSource . }
-- Convert PCDM 1.0 to PCDM 2.0 --
PREFIX ldp: <http://www.w3.org/ns/ldp#>
PREFIX ore: <http://www.openarchives.org/ore/terms/>
PREFIX pcdm: <http://pcdm.org/models#>
CONSTRUCT {
?obj a pcdm:Object ;
pcdm:hasMember ?page .
?page a pcdm:Object ;
pcdm:hasFileSet [
a pcdm:FileSet ;
pcdm:hasFile ?file ] .
?file a pcdm:File . }
WHERE {
BIND(<http://localhost:8080/fcrepo/rest/objects/1> AS ?obj) .
?obj a pcdm:Object ;
pcdm:hasMember ?page .
?page a pcdm:Object ;
pcdm:hasFile ?file .
?file a ldp:NonRdfSource , pcdm:File . }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment