Holger Knublauch

Added variables to project expressions to meet SPARQL 1.1 syntax

......@@ -127,14 +127,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 .
......@@ -429,15 +429,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
......@@ -446,12 +446,15 @@ rhspin:baaById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/BAA-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -468,12 +471,15 @@ rhspin:companyById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/Company-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -845,13 +851,16 @@ rhspin:ddrActivityStartDate
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type xsd:date ;
sp:resultVariables ([ sp:expression
[ rdf:type xsd:date ;
sp:arg1 [ rdf:type xsd:dateTime ;
sp:arg1 [ rdf:type xsd:string ;
sp:arg1 [ sp:varName "startedAt"^^xsd:string
]
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object
......@@ -940,16 +949,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
......@@ -1002,12 +1011,15 @@ rhspin:discoveryById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/Discovery-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -1036,15 +1048,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
......@@ -1053,12 +1065,15 @@ rhspin:facilityById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/Facility-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -1075,12 +1090,15 @@ rhspin:fieldById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/Field-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -1133,10 +1151,13 @@ rhspin:graphForDDR
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type rhspin:graphForLicence ;
sp:resultVariables ([ sp:expression
[ rdf:type rhspin:graphForLicence ;
arg:licence
[ sp:varName "licence"^^xsd:string
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object
......@@ -1180,9 +1201,12 @@ rhspin:graphForLicence
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ sp:varName "uri"^^xsd:string
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
......@@ -1221,10 +1245,13 @@ rhspin:graphForWellBoreWithId
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type rhspin:graphForLicence ;
sp:resultVariables ([ sp:expression
[ rdf:type rhspin:graphForLicence ;
arg:licence
[ sp:varName "licence"^^xsd:string
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
......@@ -1259,12 +1286,15 @@ rhspin:licenceById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/Licence-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -1411,11 +1441,14 @@ rhspin:normalizeWellBoreName
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type xsd:string ;
sp:resultVariables ([ sp:expression
[ rdf:type xsd:string ;
sp:arg1 [ rdf:type spif:trim ;
sp:arg1 [ sp:varName "result"^^xsd:string
]
]
] ;
sp:varName "theResult"^^xsd:string
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
......@@ -1687,17 +1720,17 @@ rhspin:npdIndividualById
] ;
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:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id to match."^^xsd:string ;
spl:predicate arg:id ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Individual> .
rhspin:npdIndividualByName
......@@ -1762,17 +1795,17 @@ rhspin:npdIndividualByName
] ;
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:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD name to match."^^xsd:string ;
spl:predicate arg:name ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Individual> .
rhspin:npdName
......@@ -1818,9 +1851,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 ;
......@@ -1830,8 +1862,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 .
......@@ -1842,7 +1875,8 @@ rhspin:parentCompanyByName
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/ParentCompany-" ;
sp:arg2 [ rdf:type rhspin:normalizeString ;
......@@ -1850,6 +1884,8 @@ rhspin:parentCompanyByName
]
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -1920,12 +1956,15 @@ rhspin:tufById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/TUF-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -1990,7 +2029,8 @@ rhspin:wellBoreById
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/WellBore-" ;
sp:arg2 [ rdf:type rhspin:normalizeString ;
......@@ -1998,6 +2038,8 @@ rhspin:wellBoreById
]
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......@@ -2059,7 +2101,8 @@ rhspin:wellByName
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/np/data/npd/Well-" ;
sp:arg2 [ rdf:type rhspin:normalizeString ;
......@@ -2067,6 +2110,8 @@ rhspin:wellByName
]
]
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ()
] ;
......