datprop2rd-npd.ttl 4.19 KB
# baseURI: http://www.reportinghub.no/refdata/transform/datprop2rd-npd
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/refdata/transform/datprop2rd

@prefix afn:     <http://jena.hpl.hp.com/ARQ/function#> .
@prefix datprop2rd:  <http://www.reportinghub.no/refdata/transform/datprop2rd#> .
@prefix datprop2rd-npd:  <http://www.reportinghub.no/refdata/transform/datprop2rd-npd#> .
@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 sp:      <http://spinrdf.org/sp#> .
@prefix spif:    <http://spinrdf.org/spif#> .
@prefix spin:    <http://spinrdf.org/spin#> .
@prefix spl:     <http://spinrdf.org/spl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

<http://www.reportinghub.no/refdata/transform/datprop2rd-npd>
      rdf:type owl:Ontology ;
      owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/refdata/transform/datprop2rd> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

owl:DatatypeProperty
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "0395 Handle classification of RD propety as NPD"^^xsd:string ;
                sp:templates ([ sp:object <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#Classification> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "clsnuri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "thisrduri"^^xsd:string
                                    ] ;
                            sp:predicate <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#hasClassified> ;
                            sp:subject
                                    [ sp:varName "clsnuri"^^xsd:string
                                    ]
                          ] [ sp:object <http://posccaesar.org/rdl/ERH00002> ;
                            sp:predicate <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#hasClassifier> ;
                            sp:subject
                                    [ sp:varName "clsnuri"^^xsd:string
                                    ]
                          ] [ sp:object <http://posccaesar.org/rdl/ERH00000> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "clsnuri"^^xsd:string
                                    ]
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "thisrduri"^^xsd:string
                                    ] ;
                            sp:predicate owl:sameAs ;
                            sp:subject spin:_this
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type spif:generateUUID
                                    ] ;
                            sp:variable
                                    [ sp:varName "uuid"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type fn:concat ;
                                      sp:arg1 "ERH" ;
                                      sp:arg2 [ sp:varName "uuid"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "pcaid"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type spif:buildURI ;
                                      sp:arg1 "<http://posccaesar.org/rdl/{?pcaid}>"
                                    ] ;
                            sp:variable
                                    [ sp:varName "clsnuri"^^xsd:string
                                    ]
                          ])
              ] .