Holger Knublauch

Added rhspin:currentUserHasAccessToFieldByName

......@@ -134,14 +134,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 .
......@@ -664,15 +664,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
......@@ -1022,6 +1022,68 @@ rhspin:companyWithName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/organization#Company> .
rhspin:currentUserHasAccessToFieldByName
rdf:type spin:Function ;
rdfs:comment "Tests whether the currently logged in user is working for a company that has a share in a licence or BAA for a field with a given name. This function is used by the download service to validate access privileges."^^xsd:string ;
rdfs:label "current user has access to field by name"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Ask ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyName
] ;
sp:variable
[ sp:varName "companyName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyWithName ;
arg:name
[ sp:varName "companyName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "company"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:npdIndividualByName ;
arg:name
[ sp:varName "fieldName"^^xsd:string
] ;
arg:type <http://www.reportinghub.no/ep/schema/facility#Field>
] ;
sp:variable
[ sp:varName "field"^^xsd:string
]
] [ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "owner"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#fieldOwner> ;
sp:subject
[ sp:varName "field"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
] [ sp:object
[ sp:varName "owner"^^xsd:string
] ;
sp:predicate rhspin:companyHasLicenceOrBAA ;
sp:subject
[ sp:varName "company"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The name of the field to check."^^xsd:string ;
spl:predicate arg:fieldName ;
spl:valueType xsd:string
] ;
spin:returnType xsd:boolean .
rhspin:currentUserHasAccessToOwner
rdf:type spin:Function ;
rdfs:comment "Tests whether the currently logged in user is working for a company that has a given licence or BAA. This function is used by the download service to validate access privileges."^^xsd:string ;
......@@ -1404,16 +1466,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
......@@ -1510,15 +1572,15 @@ rhspin:dtypeValue
] ;
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
] ;
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
] .
rhspin:facilityById
......@@ -2408,17 +2470,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
......@@ -2483,17 +2545,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
......@@ -2542,8 +2604,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:constraint
[ rdf:type spl:Argument ;
......@@ -2553,9 +2616,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:returnType xsd:boolean .
......