David Leal
# baseURI: http://www.reportinghub.no/ep/spin/report-constraints
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/ddr
# imports: http://www.reportinghub.no/ep/schema/1.0/equipment
# imports: http://www.reportinghub.no/ep/schema/1.0/facility
# imports: http://www.reportinghub.no/ep/schema/1.0/organization
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/ep/schema/1.0/well
# imports: http://www.reportinghub.no/np/schema/1.0/npd
# imports: http://www.reportinghub.no/spin/rh
@prefix : <http://www.reportinghub.no/ep/spin/report-constraints#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix ddr: <http://www.reportinghub.no/ep/schema/ddr#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rhspin: <http://www.reportinghub.no/spin/rh#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b1
] [ sp:object _:b2 ;
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object _:b3 ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/activity#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#onWellBore>
] ;
sp:path2 <http://www.reportinghub.no/ep/schema/core#temporalPartOf>
] ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyName
] ;
sp:variable _:b4
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyWithName ;
arg:name _:b4
] ;
sp:variable _:b5
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:bound ;
sp:arg1 _:b5
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object _:b3 ;
sp:predicate rhspin:companyHasLicenceForWellBore ;
sp:subject _:b5
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Your company (" ;
sp:arg2 _:b4 ;
sp:arg3 ") does not hold a licence for well bore " ;
sp:arg4 [ rdf:type rhspin:npdName ;
arg:resource _:b3
]
] ;
sp:variable _:b2
])
] .
<http://www.reportinghub.no/ep/spin/report-constraints>
rdf:type owl:Ontology ;
rdfs:comment "Constraints that need to be executed after ep-report:Report generation (without SXML triples)."^^xsd:string ;
owl:imports <http://www.reportinghub.no/spin/rh> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/ddr> ;
owl:versionInfo "0.1.0"^^xsd:string .
_:b2 sp:varName "message"^^xsd:string .
_:b3 sp:varName "wellBore"^^xsd:string .
_:b4 sp:varName "companyName"^^xsd:string .
_:b5 sp:varName "company"^^xsd:string .
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdl "http://rdl.example.org/sampleReferenceData#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
<!ENTITY p7tm "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tm#" >
<!ENTITY dm "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/data-model#" >
<!ENTITY p7tpl "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tpl#" >
<!ENTITY meta "http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata#" >
]>
<rdf:RDF xmlns="http://rdl.example.org/sampleReferenceData#"
xml:base="http://rdl.example.org/sampleReferenceData"
xmlns:owl2xml="http://www.w3.org/2006/12/owl2-xml#"
xmlns:p7tm="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tm#"
xmlns:p7tpl="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/p7tpl#"
xmlns:rdl="http://rdl.example.org/sampleReferenceData#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:dm="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/data-model#"
xmlns:meta="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:owl="http://www.w3.org/2002/07/owl#">
<owl:Ontology rdf:about="">
<rdfs:comment
>This ontology contains examples of how a Reference Data Library can be represented using the OWL native Part 8 format.</rdfs:comment>
<owl:imports rdf:resource="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/data-model"/>
<owl:imports rdf:resource="http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata"/>
</owl:Ontology>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Classes
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/data-model#Activity -->
<owl:Class rdf:about="&dm;Activity"/>
<!-- http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/data-model#ArrangedIndividual -->
<owl:Class rdf:about="&dm;ArrangedIndividual"/>
<!-- http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/data-model#AssemblyOfIndividual -->
<owl:Class rdf:about="&dm;AssemblyOfIndividual"/>
<!-- http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/data-model#PossibleIndividual -->
<owl:Class rdf:about="&dm;PossibleIndividual"/>
<!-- http://rdl.example.org/sampleReferenceData#Driving -->
<owl:Class rdf:about="#Driving">
<meta:annUniqueName>Driving</meta:annUniqueName>
<rdfs:subClassOf rdf:resource="&dm;Activity"/>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#Equipment -->
<owl:Class rdf:about="#Equipment">
<rdfs:subClassOf rdf:resource="&dm;ArrangedIndividual"/>
<rdfs:comment
>Sample class for AssemblyRelation example.</rdfs:comment>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#EquipmentHasNozzle -->
<owl:Class rdf:about="#EquipmentHasNozzle">
<rdfs:subClassOf rdf:resource="&dm;AssemblyOfIndividual"/>
<rdfs:comment
>Sample class for AssemblyRelation example.</rdfs:comment>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#HardWork -->
<owl:Class rdf:about="#HardWork">
<meta:annUniqueName>HardWork</meta:annUniqueName>
<rdfs:subClassOf rdf:resource="&dm;Activity"/>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#Nozzle -->
<owl:Class rdf:about="#Nozzle">
<rdfs:subClassOf rdf:resource="&dm;PossibleIndividual"/>
<rdfs:comment
>Sample class for AssemblyRelation example.</rdfs:comment>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#Person -->
<owl:Class rdf:about="#Person">
<meta:annUniqueName>Person</meta:annUniqueName>
<rdfs:subClassOf rdf:resource="&dm;PossibleIndividual"/>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#PipingNetworkSegment -->
<owl:Class rdf:about="#PipingNetworkSegment">
<meta:annUniqueName
>PipingNetworkSegment</meta:annUniqueName>
<rdfs:subClassOf rdf:resource="&dm;PossibleIndividual"/>
<rdfs:comment
>Sample class for AssemblyRelation example.</rdfs:comment>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#PipingNetworkSystem -->
<owl:Class rdf:about="#PipingNetworkSystem">
<meta:annUniqueName
>PipingNetworkSystem</meta:annUniqueName>
<rdfs:subClassOf rdf:resource="&dm;ArrangedIndividual"/>
<rdfs:comment
>Sample class for AssemblyRelation example.</rdfs:comment>
</owl:Class>
<!-- http://rdl.example.org/sampleReferenceData#PipingNetworkSystemHasSegment -->
<owl:Class rdf:about="#PipingNetworkSystemHasSegment">
<meta:annUniqueName
>PipingNetworkSystemHasSegment</meta:annUniqueName>
<rdfs:subClassOf rdf:resource="&dm;AssemblyOfIndividual"/>
<rdfs:comment
>Sample class for AssemblyRelation example.</rdfs:comment>
</owl:Class>
<!-- http://www.w3.org/2002/07/owl#Thing -->
<owl:Class rdf:about="&owl;Thing"/>
<!--
///////////////////////////////////////////////////////////////////////////////////////
//
// Individuals
//
///////////////////////////////////////////////////////////////////////////////////////
-->
<!-- http://rdl.example.org/sampleReferenceData#Person -->
<owl:Thing rdf:about="#Person"/>
<!-- http://rdl.example.org/sampleReferenceData#PipingNetworkSegment -->
<owl:Thing rdf:about="#PipingNetworkSegment"/>
<!-- http://rdl.example.org/sampleReferenceData#PipingNetworkSystem -->
<owl:Thing rdf:about="#PipingNetworkSystem"/>
<!-- http://rdl.example.org/sampleReferenceData#PipingNetworkSystemHasSegment -->
<owl:Thing rdf:about="#PipingNetworkSystemHasSegment"/>
</rdf:RDF>
<!-- Generated by the OWL API (version 2.2.1.1138) http://owlapi.sourceforge.net -->
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
# Saved by TopBraid on Wed Aug 17 18:10:51 BST 2011
# baseURI: http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata
@prefix iso-meta: <http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://standards.iso.org/iso/ts/15926/-8/ed-1/tech/reference-data/metadata>
rdf:type owl:Ontology ;
rdfs:comment "This ontology provides metadata properties for classes, templates and individuals." ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
iso-meta:annAccessCode
rdf:type owl:AnnotationProperty ;
rdfs:comment "A security code (resource group) of the information represented by a template instance. It is used as a parameter in an ACL (Access Control List)." ;
rdfs:label "Access Code" .
iso-meta:annAdministrativeNote
rdf:type owl:AnnotationProperty ;
rdfs:comment "An administrative note about a reference data item" ;
rdfs:label "administrative note" ;
rdfs:subPropertyOf rdfs:comment .
iso-meta:annChangeDescription
rdf:type owl:AnnotationProperty ;
rdfs:comment "A description of the most recent change." ;
rdfs:label "change description" ;
rdfs:subPropertyOf rdfs:comment .
iso-meta:annCreationDate
rdf:type owl:AnnotationProperty ;
rdfs:comment "The date of creation of a reference data item within the reference data library." ;
rdfs:label "creation date" .
iso-meta:annEffectiveDate
rdf:type owl:AnnotationProperty ;
rdfs:comment "The date of the status of the release of the reference data item (if released)." ;
rdfs:label "effective date" .
iso-meta:annExplanatoryComment
rdf:type owl:AnnotationProperty ;
rdfs:comment "A description of the reason for the creation of the refer-ence data item ." ;
rdfs:label "explanatory comment" ;
rdfs:subPropertyOf rdfs:comment .
iso-meta:annExponent
rdf:type owl:AnnotationProperty ;
rdfs:comment "The integer number which is used to derive one unit of measure from another in an 'exponentiate' operation." ;
rdfs:label "exponent" .
iso-meta:annFactor_Prefix
rdf:type owl:AnnotationProperty ;
rdfs:comment "The real number which is used to derive one unit of measure from another in a 'factor' operation. Either a number or an ISO prefix, such as 'milli' or 'kilo' can be specified." ;
rdfs:label "factor/prefix" .
iso-meta:annFirstOperand
rdf:type owl:AnnotationProperty ;
rdfs:comment "The name identifier of the first unit of measure in a 'multiply', 'divide', 'factor' or 'exponentiate' operation." ;
rdfs:label "first operand" .
iso-meta:annLastChangeDate
rdf:type owl:AnnotationProperty ;
rdfs:comment "The data of the last change to the reference data item." ;
rdfs:label "last change date" .
iso-meta:annNotes
rdf:type owl:AnnotationProperty ;
rdfs:comment "Notes and other informative text about the reference data item." ;
rdfs:label "notes" ;
rdfs:subPropertyOf rdfs:comment .
iso-meta:annOperator
rdf:type owl:AnnotationProperty ;
rdfs:comment "The operator which defined a unit of measure by an expression. The allowed values are 'multiply', 'divide', 'factor', and 'exponentiate'." ;
rdfs:label "operator" .
iso-meta:annRegistrationStatus
rdf:type owl:AnnotationProperty ;
rdfs:comment "The status of the reference data item." ;
rdfs:label "registration status" .
iso-meta:annRule
rdf:type owl:AnnotationProperty ;
rdfs:comment "A rule, method, or script applicable in application software." ;
rdfs:label "Rule" .
iso-meta:annSecondOperand
rdf:type owl:AnnotationProperty ;
rdfs:comment "The name identifier of the second unit of measure in a 'multiply' or 'divide' operation." ;
rdfs:label "second operand" .
iso-meta:annSource
rdf:type owl:AnnotationProperty ;
rdfs:comment "The source of the text definition for the reference data item." ;
rdfs:label "source" ;
rdfs:subPropertyOf rdfs:seeAlso .
iso-meta:annStewardshipContact
rdf:type owl:AnnotationProperty ;
rdfs:comment "The name of the person who is the contact for the stewardship of a reference data item." ;
rdfs:label "stewardship contact" .
iso-meta:annStewardshipOrganization
rdf:type owl:AnnotationProperty ;
rdfs:comment "The name of the organization that performs the steward-ship of a reference data item." ;
rdfs:label "stewardship organization" .
iso-meta:annSubmissionContact
rdf:type owl:AnnotationProperty ;
rdfs:comment "The name of the person who is the contact for the submission of a reference data item." ;
rdfs:label "submission contact" .
iso-meta:annSubmittingOrganization
rdf:type owl:AnnotationProperty ;
rdfs:comment "The name of the organization that performs the \"submission of a reference data item." ;
rdfs:label "submitting organization" .
iso-meta:annSymbol
rdf:type owl:AnnotationProperty ;
rdfs:comment "The symbol used to represent a unit of measure." ;
rdfs:label "symbol" .
iso-meta:annSynonym
rdf:type owl:AnnotationProperty ;
rdfs:comment "A synonym for the unique name of the reference data item" ;
rdfs:label "synonym" .
iso-meta:annTextDefinition
rdf:type owl:AnnotationProperty ;
rdfs:comment "The text definition for the reference data item." ;
rdfs:label "text definition" ;
rdfs:subPropertyOf rdfs:comment .
iso-meta:annURI
rdf:type owl:AnnotationProperty ;
rdfs:comment "A URI of the reference data item" ;
rdfs:label "URI" .
iso-meta:annUniqueName
rdf:type owl:AnnotationProperty ;
rdfs:comment "The name identifier of the reference data item" ;
rdfs:label "unique name" ;
rdfs:subPropertyOf rdfs:label .
iso-meta:annUnresolvedIssues
rdf:type owl:AnnotationProperty ;
rdfs:comment "A description of any unresolved issues for a reference data item." ;
rdfs:label "unresolved issues" .
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
......@@ -700,6 +700,40 @@ rhspin:npdName
] ;
spin:returnType xsd:string .
rhspin:npdTripleExists
rdf:type spin:Function ;
rdfs:comment "Checks whether the NPD graph contains a given triple (?arg1, ?arg2, ?arg3)."^^xsd:string ;
rdfs:label "NPD triple exists"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Ask ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object spin:_arg3 ;
sp:predicate spin:_arg2 ;
sp:subject spin:_arg1
]) ;
sp:graphNameNode npdata:npd
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The predicate to match."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType rdf:Property
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:returnType xsd:boolean .
rhspin:parentCompanyByName
rdf:type spin:Function ;
rdfs:comment "Gets the URI resource of a parent company based on its NPD name."^^xsd:string ;
......@@ -797,22 +831,11 @@ rhspin:wellBoreByName
[ rdf:type sp:Select ;
sp:resultVariables (_:b32) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:Union ;
sp:elements (([ sp:object _:b33 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b32
]) ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:replaceAll ;
sp:arg1 _:b33 ;
sp:arg2 "/0" ;
sp:arg3 "/"
sp:elements ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
] ;
sp:variable _:b34
] [ sp:object _:b34 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b32
]))
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b32
......@@ -854,21 +877,6 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b16
sp:varName "id"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
_:b15
sp:varName "startedAt"^^xsd:string .
_:b34
sp:varName "str"^^xsd:string .
_:b33
sp:varName "wellBoreName"^^xsd:string .
_:b32
sp:varName "wellBore"^^xsd:string .
......@@ -914,6 +922,15 @@ _:b19
_:b18
sp:varName "value"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
_:b16
sp:varName "id"^^xsd:string .
_:b15
sp:varName "startedAt"^^xsd:string .
_:b14
sp:varName "company"^^xsd:string .
......
<ui:group>
<div>&nbsp;</div>
<div class="logoContainer"><a href="http://www.epim.no" target="_new"><img src="lib/rh/images/logoEpim.gif" width="201" height="106" align="right" title="EPIM" /></a>
<div style="padding: 10px">
<h1>ReportingHub</h1>
<div>You are logged in as: <b>{= rhspin:userName() }</b></div>
</div>
</div>
</ui:group>
\ No newline at end of file