Holger Knublauch

Metadata progress for DPRs

# baseURI: http://www.reportinghub.no/system/schema/reporting
# imports: http://purl.org/dc/terms/
# imports: http://www.reportinghub.no/np/schema/1.0/npd
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
......@@ -16,40 +17,61 @@ sioc:id
<http://www.reportinghub.no/system/schema/reporting>
rdf:type owl:Ontology ;
rdfs:comment "The schema of metadata kept by the ReportingHub system to keep track of submitted reports. The starting point is the class foaf:Document."^^xsd:string ;
owl:imports <http://purl.org/dc/terms/> ;
owl:versionInfo "0.1.0"^^xsd:string .
owl:imports <http://purl.org/dc/terms/> , <http://www.reportinghub.no/np/schema/1.0/npd> ;
owl:versionInfo "0.2.0"^^xsd:string .
report:DDR
report:AbstractDR
rdf:type rdfs:Class ;
rdfs:comment "The metadata about a Daily Drilling Report."^^xsd:string ;
rdfs:label "DDR"^^xsd:string ;
rdfs:comment "Abstract base class for various types of daily reports."^^xsd:string ;
rdfs:subClassOf foaf:Document ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:allValuesFrom xsd:string ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty sioc:id
] ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty <http://purl.org/dc/terms/date>
owl:onProperty <http://purl.org/dc/terms/created>
] ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty report:wellBoreId
owl:onProperty <http://purl.org/dc/terms/date>
] ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:allValuesFrom xsd:string ;
owl:onProperty sioc:id
] .
report:DDR
rdf:type rdfs:Class ;
rdfs:comment "The metadata about a Daily Drilling Report."^^xsd:string ;
rdfs:label "DDR"^^xsd:string ;
rdfs:subClassOf report:AbstractDR ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty <http://purl.org/dc/terms/created>
] ;
owl:onProperty report:wellBoreId
] .
report:DPR
rdf:type rdfs:Class ;
rdfs:comment "The metadata about a Daily Production Report."^^xsd:string ;
rdfs:label "DPR"^^xsd:string ;
rdfs:subClassOf report:AbstractDR ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty sioc:id
owl:onProperty report:owner
] .
report:owner
rdf:type owl:ObjectProperty ;
rdfs:label "owner"^^xsd:string ;
rdfs:range <http://www.reportinghub.no/np/schema/npd#Owner> .
report:wellBoreId
rdf:type owl:DatatypeProperty ;
rdfs:label "well bore id"^^xsd:string .
......
......@@ -22,6 +22,11 @@
rdfs:label "id"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#owner>
rdf:type rdf:Property ;
rdfs:label "owner"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#wellBoreId>
rdf:type rdf:Property ;
rdfs:label "well bore id"^^xsd:string ;
......@@ -36,7 +41,7 @@
reportspin:graphByDDRId
rdf:type spin:Function ;
rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DDR (metadata) with a given id."^^xsd:string ;
rdfs:label "graph by DDRId"^^xsd:string ;
rdfs:label "graph by DDR id"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
......@@ -64,6 +69,37 @@ reportspin:graphByDDRId
] ;
spin:returnType rdfs:Resource .
reportspin:graphByDPRId
rdf:type spin:Function ;
rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DPR (metadata) with a given id."^^xsd:string ;
rdfs:label "graph by DPR id"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:arg1 [ sp:varName "uri"^^xsd:string
]
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/system/dpr/" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
] ;
sp:variable
[ sp:varName "uri"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the DPR metadata."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:valueType xsd:string
] ;
spin:returnType rdfs:Resource .
reportspin:idOfDDRByDateAndWellBoreId
rdf:type spin:Function ;
rdfs:comment "Gets the id of a DDR defined by date and well bore id. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ;
......@@ -110,14 +146,72 @@ reportspin:idOfDDRByDateAndWellBoreId
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the well bore."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#wellBoreId> ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#date> ;
spl:valueType xsd:date
] ;
spin:returnType xsd:string .
reportspin:idOfDPRByDateAndOwner
rdf:type spin:Function ;
rdfs:comment "Gets the id of a DPR defined by date and licence or BAA. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ;
rdfs:label "id of DPR by date and owner"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:orderBy ([ rdf:type sp:Desc ;
sp:expression
[ sp:varName "created"^^xsd:string
]
]) ;
sp:resultVariables ([ sp:varName "id"^^xsd:string
]) ;
sp:where ([ sp:object
[ sp:varName "owner"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/system/schema/reporting#owner> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object
[ sp:varName "date"^^xsd:string
] ;
sp:predicate <http://purl.org/dc/terms/date> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object
[ sp:varName "created"^^xsd:string
] ;
sp:predicate <http://purl.org/dc/terms/created> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://rdfs.org/sioc/ns#id> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the well bore."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#wellBoreId> ;
spl:valueType xsd:string
rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#date> ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The Licence or BAA."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#owner> ;
spl:valueType <http://www.reportinghub.no/np/schema/npd#Owner>
] ;
spin:returnType xsd:string .
......