David Leal

Transform to add UoMs to the PCA-RDL completed

# baseURI: http://www.reportinghub.no/ep/transform/transform-helper-schema
# imports: http://spinrdf.org/spin
# imports: http://www.epim.no/schemas/mprml/1
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
@prefix ep-spin-lib: <http://www.reportinghub.no/ep/spin/lib#> .
@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 sp: <http://spinrdf.org/sp#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix transhelp: <http://www.reportinghub.no/ep/transform/transform-helper-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.reportinghub.no/ep/transform/transform-helper-schema>
rdf:type owl:Ontology ;
rdfs:comment "The Transform Helper Schema is the set of properties and classes used for the creation of temporary data used as part of the ERH transformations. All instances of classes and uses of these properties is deleted before the triples are stored in the RDF database."^^xsd:string ;
owl:imports <http://www.epim.no/schemas/mprml/1> , <http://www.reportinghub.no/ep/schema/1.0/activity> ;
owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.epim.no/schemas/mprml/1> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
transhelp:buildRdlURI
rdf:type spin:Function ;
rdfs:label "build RDL URI"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "uri"^^xsd:string
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildURI ;
sp:arg1 "http://posccaesar.org/rdl/" ;
sp:arg2 [ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 spin:_arg1
]
] ;
sp:variable
[ sp:varName "uri"^^xsd:string
]
])
] .
transhelp:derivedFrom
rdf:type owl:ObjectProperty .
transhelp:facilityIdentifier
rdf:type owl:DatatypeProperty , owl:FunctionalProperty .
rdf:type owl:FunctionalProperty , owl:DatatypeProperty .
transhelp:forComment
rdf:type owl:ObjectProperty ;
......@@ -29,34 +55,39 @@ transhelp:forComment
transhelp:hasDerivedText
rdf:type owl:DatatypeProperty .
transhelp:hasEquivalentInRDL
rdf:type owl:ObjectProperty ;
rdfs:comment "References the RDL class equivalent to a Thing in the EPIM ontology."^^xsd:string ;
rdfs:label "has equivalent in RDL"^^xsd:string .
transhelp:interval
rdf:type owl:DatatypeProperty , owl:FunctionalProperty .
rdf:type owl:FunctionalProperty , owl:DatatypeProperty .
transhelp:intervalEnd
rdf:type owl:DatatypeProperty , owl:FunctionalProperty .
rdf:type owl:FunctionalProperty , owl:DatatypeProperty .
transhelp:intervalIdentifier
rdf:type owl:DatatypeProperty , owl:FunctionalProperty .
rdf:type owl:FunctionalProperty , owl:DatatypeProperty .
transhelp:intervalStart
rdf:type owl:DatatypeProperty , owl:FunctionalProperty .
rdf:type owl:FunctionalProperty , owl:DatatypeProperty .
transhelp:label
rdf:type owl:DatatypeProperty , owl:FunctionalProperty .
rdf:type owl:FunctionalProperty , owl:DatatypeProperty .
transhelp:mapsTo
rdf:type rdf:Property .
transhelp:materialClassMapsToMPREnumeration
rdf:type owl:FunctionalProperty , owl:InverseFunctionalProperty , owl:ObjectProperty ;
rdf:type owl:ObjectProperty , owl:InverseFunctionalProperty , owl:FunctionalProperty ;
rdfs:label "material class maps to MPR enumeration"^^xsd:string ;
rdfs:subPropertyOf transhelp:mapsTo .
transhelp:nominalInstant
rdf:type owl:DatatypeProperty , owl:FunctionalProperty .
rdf:type owl:FunctionalProperty , owl:DatatypeProperty .
transhelp:quantitySpaceMapsToClassOfScale
rdf:type owl:FunctionalProperty , owl:InverseFunctionalProperty , owl:ObjectProperty ;
rdf:type owl:ObjectProperty , owl:InverseFunctionalProperty , owl:FunctionalProperty ;
rdfs:label "quantity space maps to class of scale"^^xsd:string ;
rdfs:subPropertyOf transhelp:mapsTo .
......
# baseURI: http://www.reportinghub.no/refdata/transform/uomprop2rd
# imports: http://posccaesar.org/rdl
# imports: http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003
# imports: http://rds.posccaesar.org/2008/06/OWL/RDL
# imports: http://rds.posccaesar.org/2008/06/OWL/RDL-annotations
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/drilling
......@@ -11,6 +11,9 @@
@prefix RDL-annotations: <http://rds.posccaesar.org/2008/06/OWL/RDL-annotations#> .
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
@prefix drilling: <http://www.reportinghub.no/ep/schema/1.0/drilling#> .
@prefix ep-core: <http://www.reportinghub.no/ep/schema/core#> .
@prefix ep-dpr-spin-lib: <http://www.reportinghub.no/ep/dpr/spin/1.1/lib#> .
@prefix ep-spin-lib: <http://www.reportinghub.no/ep/spin/lib#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pca-dm: <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#> .
......@@ -21,21 +24,59 @@
@prefix spif: <http://spinrdf.org/spif#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix transhelp: <http://www.reportinghub.no/ep/transform/transform-helper-schema#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.reportinghub.no/refdata/transform/uomprop2rd>
rdf:type owl:Ontology ;
owl:imports <http://rds.posccaesar.org/2008/06/OWL/RDL> , <http://www.reportinghub.no/ep/transform/transform-helper-schema> , <http://www.reportinghub.no/ep/schema/1.0/drilling> , <http://spinrdf.org/spin> , <http://rds.posccaesar.org/2008/06/OWL/RDL-annotations> , <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003> , <http://www.reportinghub.no/refdata/transform/quantityToClassOfScaleMap> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
ep-core:PerLength
rdf:type ep-core:PropertySpace .
ep-core:ProductivityIndex
rdf:type ep-core:PropertySpace .
owl:DatatypeProperty
ep-core:PropertySpace
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "0341 Set the domain and classification"^^xsd:string ;
rdfs:comment "10331 Set URI and designation for EHR RD from a PropertySpace - not already in RDL"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "rdDomain"^^xsd:string
[ sp:varName "now"^^xsd:string
] ;
sp:predicate pca-dm:hasDomain ;
sp:predicate <http://posccaesar.org/rdl/hasCreationDate> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "pcaid"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasIdPCA> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object pca-dm:PropertySpace ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object "EPIM Property space imported into the RDL" ;
sp:predicate <http://posccaesar.org/rdl/hasNoteAdmin> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object <http://posccaesar.org/rdl/ERH00000> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
......@@ -44,9 +85,7 @@ owl:DatatypeProperty
sp:subject
[ sp:varName "clsncuri"^^xsd:string
]
] [ sp:object
[ sp:varName "classOfScale"^^xsd:string
] ;
] [ sp:object <http://posccaesar.org/rdl/ERH00001> ;
sp:predicate pca-dm:hasClassifier ;
sp:subject
[ sp:varName "clsncuri"^^xsd:string
......@@ -63,78 +102,135 @@ owl:DatatypeProperty
sp:subject
[ sp:varName "clsncuri"^^xsd:string
]
]) ;
sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
sp:predicate rdf:type ;
sp:subject spin:_this
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "domain"^^xsd:string
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate rdfs:domain ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "rdDomain"^^xsd:string
] ;
sp:predicate owl:sameAs ;
sp:subject
[ sp:varName "domain"^^xsd:string
]
] [ rdf:type sp:Optional ;
]) ;
sp:where ([ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "classOfScale"^^xsd:string
[ sp:varName "seeReferenceData"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#quantitySpaceMapsToClassOfScale> ;
sp:subject
[ sp:varName "domain"^^xsd:string
]
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
])
] [ sp:object
[ sp:varName "label"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:generateUUID
] ;
sp:variable
[ sp:varName "clsnuuid"^^xsd:string
[ sp:varName "uuid"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "ERH" ;
sp:arg2 [ sp:varName "clsnuuid"^^xsd:string
sp:arg2 [ sp:varName "uuid"^^xsd:string
]
] ;
sp:variable
[ sp:varName "clsnid"^^xsd:string
[ sp:varName "pcaid"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:buildURI ;
sp:arg1 "<http://posccaesar.org/rdl/{?clsnid}>"
sp:arg1 "<http://posccaesar.org/rdl/{?pcaid}>"
] ;
sp:variable
[ sp:varName "clsncuri"^^xsd:string
[ sp:varName "thisrduri"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:upper-case ;
sp:arg1 [ sp:varName "label"^^xsd:string
]
] ;
sp:variable
[ sp:varName "designation"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:now
] ;
sp:variable
[ sp:varName "now"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "0340a Set URI and designation for EHR RD from Datatype Property that ARE UoM - no label"^^xsd:string ;
rdfs:comment "10330 Set map from EHR to RDL for a property space"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate owl:sameAs ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object "EPIM Property space mapped to RDL by designation identity" ;
sp:predicate <http://posccaesar.org/rdl/hasNoteAdmin> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "label"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "seeReferenceData"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
])
] [ sp:object pca-dm:SinglePropertyDimension ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "desigation"^^xsd:string
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:upper-case ;
sp:arg1 [ sp:varName "label"^^xsd:string
]
] ;
sp:variable
[ sp:varName "designation"^^xsd:string
]
])
] .
ep-core:Scale
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10341a Set URI and designation for EHR RD from Datatype Property that ARE UoM - no label"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "pcaid"^^xsd:string
] ;
......@@ -147,36 +243,26 @@ owl:DatatypeProperty
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object "Scale imported from the EPIM schema - no label" ;
] [ sp:object "EPIM Scale imported into the RDL - no label" ;
sp:predicate <http://posccaesar.org/rdl/hasNoteAdmin> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
] [ sp:object
[ sp:varName "thisrduri"^^xsd:string
]
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
]) ;
sp:where ([ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "same"^^xsd:string
[ sp:varName "equivalentInRDL"^^xsd:string
] ;
sp:predicate owl:sameAs ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "seeReferenceData"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#seeReferenceData> ;
sp:subject spin:_this
])
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
sp:predicate rdf:type ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "label"^^xsd:string
] ;
sp:predicate rdfs:label ;
......@@ -213,7 +299,7 @@ owl:DatatypeProperty
sp:arg1 "no label"
] ;
sp:variable
[ sp:varName "desigation"^^xsd:string
[ sp:varName "designation"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
......@@ -235,40 +321,25 @@ owl:DatatypeProperty
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "0342 Set the range - not Beaufort scale which has an integer range"^^xsd:string ;
sp:templates ([ sp:object <http://rds.posccaesar.org/2008/06/OWL/RDL#RDS999900710> ;
sp:predicate pca-dm:hasCodomain ;
rdfs:comment "10341 Set URI and designation for EHR RD from a Datatype Property that is a UoM"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "now"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasCreationDate> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
sp:predicate rdf:type ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object "Beaufort scale number" ;
sp:predicate rdfs:label ;
sp:subject spin:_this
])
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
] [ sp:object
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "0340 Set URI and designation for EHR RD from Datatype Property that ARE UoM"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate owl:sameAs ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "desigation"^^xsd:string
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
......@@ -284,7 +355,7 @@ owl:DatatypeProperty
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object "Scale imported from the EPIM schema" ;
] [ sp:object "EPIM Scale imported into the RDL" ;
sp:predicate <http://posccaesar.org/rdl/hasNoteAdmin> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
......@@ -316,34 +387,29 @@ owl:DatatypeProperty
sp:subject
[ sp:varName "clsncuri"^^xsd:string
]
] [ sp:object spin:_this ;
sp:predicate <http://www.reportinghub.no/ep/transform/transform-helper-schema#derivedFrom> ;
sp:subject
] [ sp:object
[ sp:varName "thisrduri"^^xsd:string
]
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
]) ;
sp:where ([ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "same"^^xsd:string
] ;
sp:predicate owl:sameAs ;
sp:subject spin:_this
])
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "seeReferenceData"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#seeReferenceData> ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
])
] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
sp:predicate rdf:type ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "label"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object "undefined scale" ;
sp:predicate rdfs:label ;
sp:subject spin:_this
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:generateUUID
......@@ -376,7 +442,14 @@ owl:DatatypeProperty
]
] ;
sp:variable
[ sp:varName "desigation"^^xsd:string
[ sp:varName "designation"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:now
] ;
sp:variable
[ sp:varName "now"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
......@@ -395,4 +468,356 @@ owl:DatatypeProperty
sp:arg2 "http://www.w3.org/2004/02/skos/core#"
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10342a Check for missing domain"^^xsd:string ;
sp:templates ([ sp:object "No domain specified for EPIM Scale" ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "domain"^^xsd:string
] ;
sp:predicate rdfs:domain ;
sp:subject spin:_this
])
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10344 Set the range - not Beaufort scale which has an integer range"^^xsd:string ;
sp:templates ([ sp:object <http://posccaesar.org/rdl/RDS999900710> ;
sp:predicate pca-dm:hasCodomain ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object "Beaufort scale number" ;
sp:predicate rdfs:label ;
sp:subject spin:_this
])
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10340 Set map from EHR to RDL for a scale"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object "EPIM Scale mapped to RDL by designation identity" ;
sp:predicate <http://posccaesar.org/rdl/hasNoteAdmin> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "label"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "seeReferenceData"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
])
] [ sp:object pca-dm:Scale ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "designation"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:upper-case ;
sp:arg1 [ sp:varName "label"^^xsd:string
]
] ;
sp:variable
[ sp:varName "designation"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10342c Check for EPIM - RDL domain mismatch"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "mismatchMessage"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "domain"^^xsd:string
] ;
sp:predicate rdfs:domain ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "rdDomainEPIM"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject
[ sp:varName "domain"^^xsd:string
]
] [ sp:object
[ sp:varName "rdDomainDesignationEPIM"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:subject
[ sp:varName "rdDomainEPIM"^^xsd:string
]
] [ sp:object
[ sp:varName "rdDomainRDL"^^xsd:string
] ;
sp:predicate pca-dm:hasDomain ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
] [ sp:object
[ sp:varName "rdDomainDesignationRDL"^^xsd:string
] ;
sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
sp:subject
[ sp:varName "rdDomainRDL"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:ne ;
sp:arg1 [ sp:varName "rdDomainEPIM"^^xsd:string
] ;
sp:arg2 [ sp:varName "rdDomainRDL"^^xsd:string
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "The domain in EPIM is '" ;
sp:arg2 [ sp:varName "rdDomainDesignationEPIM"^^xsd:string
] ;
sp:arg3 "' but the domain in the RDL is '" ;
sp:arg4 [ sp:varName "rdDomainDesignationRDL"^^xsd:string
] ;
sp:arg5 "'."
] ;
sp:variable
[ sp:varName "mismatchMessage"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10342 Set the domain"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "rdDomain"^^xsd:string
] ;
sp:predicate pca-dm:hasDomain ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "domain"^^xsd:string
] ;
sp:predicate rdfs:domain ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "rdDomain"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject
[ sp:varName "domain"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10343 Set the classification"^^xsd:string ;
sp:templates ([ sp:object pca-dm:Classification ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "clsncuri"^^xsd:string
]
] [ sp:object
[ sp:varName "classOfScale"^^xsd:string
] ;
sp:predicate pca-dm:hasClassifier ;
sp:subject
[ sp:varName "clsncuri"^^xsd:string
]
] [ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate pca-dm:hasClassified ;
sp:subject
[ sp:varName "clsncuri"^^xsd:string
]
] [ sp:object <http://posccaesar.org/rdl/ERH00000> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "clsncuri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "domain"^^xsd:string
] ;
sp:predicate rdfs:domain ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "rdDomain"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject
[ sp:varName "domain"^^xsd:string
]
] [ sp:object
[ sp:varName "classOfScale"^^xsd:string
] ;
sp:predicate transhelp:quantitySpaceMapsToClassOfScale ;
sp:subject
[ sp:varName "domain"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:generateUUID
] ;
sp:variable
[ sp:varName "clsnuuid"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "ERH" ;
sp:arg2 [ sp:varName "clsnuuid"^^xsd:string
]
] ;
sp:variable
[ sp:varName "clsnid"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:buildURI ;
sp:arg1 "<http://posccaesar.org/rdl/{?clsnid}>"
] ;
sp:variable
[ sp:varName "clsncuri"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10342b Check for domain not in RDL."^^xsd:string ;
sp:templates ([ sp:object "Domain of EPIM Scale not mapped to the RDL" ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "domain"^^xsd:string
] ;
sp:predicate rdfs:domain ;
sp:subject spin:_this
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object
[ sp:varName "rdDomain"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject
[ sp:varName "domain"^^xsd:string
]
])
])
] .
<http://www.reportinghub.no/refdata/transform/uomprop2rd>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/ep/schema/1.0/drilling> , <http://www.reportinghub.no/ep/transform/transform-helper-schema> , <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003> , <http://spinrdf.org/spin> , <http://rds.posccaesar.org/2008/06/OWL/RDL-annotations> , <http://www.reportinghub.no/refdata/transform/quantityToClassOfScaleMap> , <http://posccaesar.org/rdl> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
owl:Thing
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "10000 Set preexisting map from EHR to RDL"^^xsd:string ;
sp:templates ([ sp:object
[ sp:varName "thisrduri"^^xsd:string
] ;
sp:predicate transhelp:hasEquivalentInRDL ;
sp:subject spin:_this
] [ sp:object "EPIM schema mapped to RDL by ep-core:seeReferenceData statement" ;
sp:predicate <http://posccaesar.org/rdl/hasNoteAdmin> ;
sp:subject
[ sp:varName "thisrduri"^^xsd:string
]
]) ;
sp:where ([ sp:object
[ sp:varName "rdlURIString"^^xsd:string
] ;
sp:predicate ep-core:seeReferenceData ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:substring ;
sp:arg1 [ sp:varName "rdlURIString"^^xsd:string
] ;
sp:arg2 27
] ;
sp:variable
[ sp:varName "thisrdlocal"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type transhelp:buildRdlURI ;
sp:arg1 [ sp:varName "thisrdlocal"^^xsd:string
]
] ;
sp:variable
[ sp:varName "thisrduri"^^xsd:string
]
])
] .
......