Holger Knublauch

DPR helper functions/template change

......@@ -116,14 +116,14 @@ arg:wellName
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The property that must be used in the result resource."^^xsd:string ;
spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ;
spl:valueType rdf:Property
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
rdfs:comment "The property that must be used in the result resource."^^xsd:string ;
spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ;
spl:valueType rdf:Property
] ;
spin:returnType rdfs:Resource .
......@@ -233,7 +233,7 @@ rhspin:GetLicenceInfo
rhspin:GetLicensesAndBAAsOfCompanyName
rdf:type spin:SelectTemplate ;
rdfs:comment "Gets the licences and BAAs that a company with a given name has access to. Result variables are ?owner and ?ownerName."^^xsd:string ;
rdfs:comment "Gets the licences and BAAs that a company with a given name has access to. Result variables are ?ownerId and ?ownerName."^^xsd:string ;
rdfs:label "Get licenses and BAAs of company name"^^xsd:string ;
rdfs:subClassOf spin:SelectTemplates ;
spin:body
......@@ -241,7 +241,7 @@ rhspin:GetLicensesAndBAAsOfCompanyName
sp:distinct "true"^^xsd:boolean ;
sp:orderBy ([ sp:varName "ownerName"^^xsd:string
]) ;
sp:resultVariables ([ sp:varName "owner"^^xsd:string
sp:resultVariables ([ sp:varName "ownerId"^^xsd:string
] [ sp:varName "ownerName"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
......@@ -271,6 +271,13 @@ rhspin:GetLicensesAndBAAsOfCompanyName
sp:subject
[ sp:varName "owner"^^xsd:string
]
] [ sp:object
[ sp:varName "ownerId"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject
[ sp:varName "owner"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
])
......@@ -411,15 +418,15 @@ rhspin:WDRTableTemplates
spin:abstract "true"^^xsd:boolean ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DDR that serves as root of the query."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The start date of the reporting week."^^xsd:string ;
spl:predicate arg:startDate ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DDR that serves as root of the query."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] .
rhspin:baaById
......@@ -869,16 +876,16 @@ rhspin:ddrOfWeek
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The well bore that the DDR must be about."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The first day of the week."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The well bore that the DDR must be about."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport> .
rhspin:ddrWellBoreId
......@@ -965,15 +972,15 @@ rhspin:dtypeValue
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject of the value."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The predicate that points to the reified value."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType rdf:Property
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject of the value."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] .
rhspin:facilityById
......@@ -1519,10 +1526,10 @@ rhspin:npdId
spl:valueType <http://www.reportinghub.no/np/schema/npd#NPDIndividual>
] .
rhspin:npdIndividualByName
rhspin:npdIndividualById
rdf:type spin:Function ;
rdfs:comment "Finds an NPD individual by its npd:name (?name). The individual also has to have the given class (?type) as a direct or indirect rdf:type."^^xsd:string ;
rdfs:label "NPD individual by name"^^xsd:string ;
rdfs:comment "Finds an NPD individual by its npd:id (?ud). The individual also has to have the given class (?type) as a direct or indirect rdf:type."^^xsd:string ;
rdfs:label "NPD individual by id"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
......@@ -1562,9 +1569,9 @@ rhspin:npdIndividualByName
]))
] [ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "name"^^xsd:string
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject
[ sp:varName "individual"^^xsd:string
]
......@@ -1581,17 +1588,92 @@ rhspin:npdIndividualByName
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id to match."^^xsd:string ;
spl:predicate arg:id ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The rdf:type that the result must have."^^xsd:string ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:type ;
spl:valueType rdfs:Class
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Individual> .
rhspin:npdIndividualByName
rdf:type spin:Function ;
rdfs:comment "Finds an NPD individual by its npd:name (?name). The individual also has to have the given class (?type) as a direct or indirect rdf:type."^^xsd:string ;
rdfs:label "NPD individual by name"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "individual"^^xsd:string
]) ;
sp:where ([ rdf:type sp:Union ;
sp:elements (([ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "type"^^xsd:string
] ;
sp:path [ rdf:type sp:ModPath ;
sp:modMax -2 ;
sp:modMin 0 ;
sp:subPath rdfs:subClassOf
] ;
sp:subject
[ sp:varName "a"^^xsd:string
]
]) ;
sp:graphNameNode <http://www.reportinghub.no/np/schema/1.0/npd>
]) ([ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "type"^^xsd:string
] ;
sp:path [ rdf:type sp:ModPath ;
sp:modMax -2 ;
sp:modMin 0 ;
sp:subPath rdfs:subClassOf
] ;
sp:subject
[ sp:varName "a"^^xsd:string
]
]) ;
sp:graphNameNode <http://www.reportinghub.no/ep/schema/1.0/facility>
]))
] [ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "name"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject
[ sp:varName "individual"^^xsd:string
]
] [ sp:object
[ sp:varName "a"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "individual"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD name to match."^^xsd:string ;
spl:predicate arg:name ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The rdf:type that the result must have."^^xsd:string ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:type ;
spl:valueType rdfs:Class
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Individual> .
rhspin:npdName
......@@ -1637,9 +1719,8 @@ rhspin:npdTripleExists
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
] ;
spin:constraint
[ rdf:type spl:Argument ;
......@@ -1649,8 +1730,9 @@ rhspin:npdTripleExists
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:returnType xsd:boolean .
......