makeoldrd.ttl 12.3 KB
# baseURI: http://www.reportinghub.no/refdata/2013-03-30/makeoldrd
# imports: file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/refdata/2013-03-30/drilling

@prefix fn:      <http://www.w3.org/2005/xpath-functions#> .
@prefix makeoldrd:  <http://www.reportinghub.no/refdata/2013-03-30/makeoldrd#> .
@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 smf:     <http://topbraid.org/sparqlmotionfunctions#> .
@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#> .

<file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#erh-drilling-rd-classes>
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "100 CLASS uri, des, id and def"^^xsd:string ;
                sp:templates ([ sp:object
                                    [ sp:varName "p2uri"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "rduri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "des"^^xsd:string
                                    ] ;
                            sp:predicate <http://posccaesar.org/rdl/hasDesignation> ;
                            sp:subject
                                    [ sp:varName "rduri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "def"^^xsd:string
                                    ] ;
                            sp:predicate <http://posccaesar.org/rdl/hasDefinition> ;
                            sp:subject
                                    [ sp:varName "rduri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "rdlid"^^xsd:string
                                    ] ;
                            sp:predicate <http://posccaesar.org/rdl/hasIdPCA> ;
                            sp:subject
                                    [ sp:varName "rduri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "rduri"^^xsd:string
                                    ] ;
                            sp:predicate owl:sameAs ;
                            sp:subject
                                    [ sp:varName "ontitemuri"^^xsd:string
                                    ]
                          ] [ sp:object <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#Specialization> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "specuri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "superuri"^^xsd:string
                                    ] ;
                            sp:predicate <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#hasSuperclass> ;
                            sp:subject
                                    [ sp:varName "specuri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "rduri"^^xsd:string
                                    ] ;
                            sp:predicate <http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#hasSubclass> ;
                            sp:subject
                                    [ sp:varName "specuri"^^xsd:string
                                    ]
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "localname"^^xsd:string
                                    ] ;
                            sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#eRHLocalname> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "ont"^^xsd:string
                                    ] ;
                            sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#eRHOntology> ;
                            sp:subject spin:_this
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type fn:concat ;
                                      sp:arg1 [ sp:varName "ont"^^xsd:string
                                              ] ;
                                      sp:arg2 [ sp:varName "localname"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "ontitem"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type spif:buildURI ;
                                      sp:arg1 [ sp:varName "ontitem"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "ontitemuri"^^xsd:string
                                    ]
                          ] [ rdf:type sp:NotExists ;
                            sp:elements ([ sp:object
                                                [ sp:varName "anything"^^xsd:string
                                                ] ;
                                        sp:predicate owl:sameAs ;
                                        sp:subject
                                                [ sp:varName "ontitemuri"^^xsd:string
                                                ]
                                      ])
                          ] [ sp:object
                                    [ sp:varName "rdlid"^^xsd:string
                                    ] ;
                            sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#rDId> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "rduristr"^^xsd:string
                                    ] ;
                            sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#rDURI> ;
                            sp:subject spin:_this
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type smf:buildURI ;
                                      sp:arg1 [ sp:varName "rduristr"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "rduri"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "des"^^xsd:string
                                    ] ;
                            sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#RDDesignation> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "def"^^xsd:string
                                    ] ;
                            sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#rDDefinition> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "p2name"^^xsd:string
                                    ] ;
                            sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#entityType> ;
                            sp:subject spin:_this
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type fn:concat ;
                                      sp:arg1 "http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#" ;
                                      sp:arg2 [ sp:varName "p2name"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "p2thing"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type smf:buildURI ;
                                      sp:arg1 [ sp:varName "p2thing"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "p2uri"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "super"^^xsd:string
                                                ] ;
                                        sp:predicate <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv#rDSuperclassURI> ;
                                        sp:subject spin:_this
                                      ] [ rdf:type sp:Bind ;
                                        sp:expression
                                                [ rdf:type smf:buildURI ;
                                                  sp:arg1 [ sp:varName "super"^^xsd:string
                                                          ]
                                                ] ;
                                        sp:variable
                                                [ sp:varName "superuri"^^xsd:string
                                                ]
                                      ] [ rdf:type sp:Bind ;
                                        sp:expression
                                                [ rdf:type spif:generateUUID
                                                ] ;
                                        sp:variable
                                                [ sp:varName "specuuid"^^xsd:string
                                                ]
                                      ] [ rdf:type sp:Bind ;
                                        sp:expression
                                                [ rdf:type fn:concat ;
                                                  sp:arg1 "ERH" ;
                                                  sp:arg2 [ sp:varName "specuuid"^^xsd:string
                                                          ]
                                                ] ;
                                        sp:variable
                                                [ sp:varName "specid"^^xsd:string
                                                ]
                                      ] [ rdf:type sp:Bind ;
                                        sp:expression
                                                [ rdf:type spif:buildURI ;
                                                  sp:arg1 "<http://posccaesar.org/rdl/{?specid}>"
                                                ] ;
                                        sp:variable
                                                [ sp:varName "specuri"^^xsd:string
                                                ]
                                      ])
                          ])
              ] .

<http://www.reportinghub.no/refdata/2013-03-30/makeoldrd>
      rdf:type owl:Ontology ;
      owl:imports <file:///www.reportinghub.no/refdata/2013-03-30/erh-drilling-rd-classes.tsv> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/refdata/2013-03-30/drilling> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .