PCA Reference Data and Services - Staging
Toggle Dark/Light/Auto modeToggle Dark/Light/Auto modeToggle Dark/Light/Auto modeBack to homepage

Graph content (UoM)

1 Introduction

This page describes some typical SPARQL queries over the Unit of Measure ontology module. Any DESCRIBE query will return a graph of triples. The common format for such results is Turtle.

Why this matters: In some cases, it’s interesting to look at the raw content of the ontology itself. This is obviously possible if you download the source ontology as a file; for the UoM module, you will find a list of file formats by opening the URI of a version of the ontology, like https://rds.posccaesar.org/ontology/plm/ont/uom/0.0.1/.

Rather than a whole ontology, we often wish to see a just a selection of ontology resources. For this, use the SPARQL DESCRIBE form of queries.

In the following, the long list of prefixes used to abbreviate URIs for readability have been taken out of the Turtle RDF listings. They will be shown if you try these queries yourself with Fuseki. For a list of common prefixes, see, e.g., here.

2 A simple DESCRIBE query

The simplest DESCRIBE query will simply ask for an entity in the ontology using its URI. The result is a selection of triples that, well, “describe” that entity (see the W3C SPARQL page for a discussion).

The physical quantity area (an OWL class) is a good example, with several object property restrictions and some characteristic annotations.

Query:

# select triples that describe rdl:PCA_100003566 "area"
describe <http://rds.posccaesar.org/ontology/plm/rdl/PCA_100003566>

Results:

For this initial example, we show three common result formats: Turtle, RDF/XML, and JSON-LD. With The following examples will have Turtle only.

rdl:PCA_100003566  a       rdl:PCA_100003555 , owl:NamedIndividual , owl:Class ;
        rdfs:label         "area" ;
        rdfs:subClassOf    lis:PhysicalQuantity ;
        rdfs:subClassOf    [ a                  owl:Restriction ;
                             owl:allValuesFrom  lis:PhysicalObject ;
                             owl:onProperty     lis:qualityOf
                           ] ;
        rdfs:subClassOf    [ a                  owl:Restriction ;
                             owl:allValuesFrom  rdl:PCA_100003614 ;
                             owl:onProperty     lis:qualityQuantifiedAs
                           ] ;
        rdfs:subClassOf    [ a               owl:Restriction ;
                             owl:hasValue    rdl:PCA_100003738 ;
                             owl:onProperty  rdl:PCA_100003729
                           ] ;
        rdl:PCA_100000510  rdl:PCA_100003721 ;
        om:symbol          "A" ;
        skos:exactMatch    <http://sandbox.dexpi.org/informationmodel/PhysicalQuantityTypeArea> , <http://qudt.org/vocab/quantitykind/Area> , rdl:CFIHOS-45000026 , om:Area , pca:RDS349874 .
<rdf:RDF
    xmlns:req="https://w3id.org/requirement-ontology/rdl/"
    xmlns:o-owl-ax="http://tpl.ottr.xyz/owl/axiom/0.1/"
    xmlns:o-owl-dec="http://tpl.ottr.xyz/owl/declaration/0.1/"
    xmlns:lis12="http://standards.iso.org/iso/15926/ontology/life-cycle-integration/"
    xmlns:o-docttr="http://tpl.ottr.xyz/p/docttr/0.1/"
    xmlns:o-owl-ma="http://tpl.ottr.xyz/owl/macro/0.1/"
    xmlns:ntpl="http://norsok.org/templates/"
    xmlns:dcterms="http://purl.org/dc/terms/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:obo="http://purl.obolibrary.org/obo/"
    xmlns:prov="http://www.w3.org/ns/prov#"
    xmlns:pca="http://data.posccaesar.org/rdl/"
    xmlns:skos="http://www.w3.org/2004/02/skos/core#"
    xmlns:sd="http://www.w3.org/ns/sparql-service-description#"
    xmlns:vann="http://purl.org/vocab/vann/"
    xmlns:orcid="https://orcid.org/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
    xmlns:lis="http://rds.posccaesar.org/ontology/lis14/rdl/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:lis2="http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#"
    xmlns:rdl="http://rds.posccaesar.org/ontology/plm/rdl/"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:rrdl="http://w3id.org/readi/rdl/"
    xmlns:void="http://rdfs.org/ns/void#"
    xmlns:o-rdfs="http://tpl.ottr.xyz/rdfs/0.1/"
    xmlns:plmtpl="http://rds.posccaesar.org/ontology/plm/tpl/0.1/"
    xmlns:listpl="http://rds.posccaesar.org/ontology/lis14/tpl/0.1/"
    xmlns:ottr="http://ns.ottr.xyz/0.4/"
    xmlns:ex="http://example.org/"
    xmlns="http://www.semanticweb.org/owl/owlapi/turtle#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:dcmitype="http://purl.org/dc/dcmitype/"
    xmlns:o-owl-re="http://tpl.ottr.xyz/owl/restriction/0.1/"
    xmlns:pav="http://purl.org/pav/"
    xmlns:o-rdf="http://tpl.ottr.xyz/rdf/0.1/"
    xmlns:reqtpl="http://w3id.org/requirement-ontology/tpl/0.1/"
    xmlns:foaf="http://xmlns.com/foaf/0.1/"
    xmlns:om="http://www.ontology-of-units-of-measure.org/resource/om-2/" >
  <rdf:Description rdf:nodeID="A0">
    <owl:hasValue rdf:resource="http://rds.posccaesar.org/ontology/plm/rdl/PCA_100003738"/>
    <owl:onProperty rdf:resource="http://rds.posccaesar.org/ontology/plm/rdl/PCA_100003729"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="A1">
    <owl:allValuesFrom rdf:resource="http://rds.posccaesar.org/ontology/plm/rdl/PCA_100003614"/>
    <owl:onProperty rdf:resource="http://rds.posccaesar.org/ontology/lis14/rdl/qualityQuantifiedAs"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://rds.posccaesar.org/ontology/plm/rdl/PCA_100003566">
    <rdl:PCA_100000510 rdf:resource="http://rds.posccaesar.org/ontology/plm/rdl/PCA_100003721"/>
    <rdfs:subClassOf rdf:nodeID="A2"/>
    <om:symbol>A</om:symbol>
    <rdfs:subClassOf rdf:nodeID="A1"/>
    <rdf:type rdf:resource="http://rds.posccaesar.org/ontology/plm/rdl/PCA_100003555"/>
    <skos:exactMatch rdf:resource="http://sandbox.dexpi.org/informationmodel/PhysicalQuantityTypeArea"/>
    <rdfs:label>area</rdfs:label>
    <rdfs:subClassOf rdf:nodeID="A0"/>
    <skos:exactMatch rdf:resource="http://qudt.org/vocab/quantitykind/Area"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#NamedIndividual"/>
    <skos:exactMatch rdf:resource="http://rds.posccaesar.org/ontology/plm/rdl/CFIHOS-45000026"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
    <rdfs:subClassOf rdf:resource="http://rds.posccaesar.org/ontology/lis14/rdl/PhysicalQuantity"/>
    <skos:exactMatch rdf:resource="http://www.ontology-of-units-of-measure.org/resource/om-2/Area"/>
    <skos:exactMatch rdf:resource="http://data.posccaesar.org/rdl/RDS349874"/>
  </rdf:Description>
  <rdf:Description rdf:nodeID="A2">
    <owl:allValuesFrom rdf:resource="http://rds.posccaesar.org/ontology/lis14/rdl/PhysicalObject"/>
    <owl:onProperty rdf:resource="http://rds.posccaesar.org/ontology/lis14/rdl/qualityOf"/>
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Restriction"/>
  </rdf:Description>
</rdf:RDF>
{
  "@graph" : [ {
    "@id" : "_:b0",
    "@type" : "owl:Restriction",
    "hasValue" : "rdl:PCA_100003738",
    "onProperty" : "rdl:PCA_100003729"
  }, {
    "@id" : "_:b1",
    "@type" : "owl:Restriction",
    "allValuesFrom" : "lis:PhysicalObject",
    "onProperty" : "lis:qualityOf"
  }, {
    "@id" : "_:b2",
    "@type" : "owl:Restriction",
    "allValuesFrom" : "rdl:PCA_100003614",
    "onProperty" : "lis:qualityQuantifiedAs"
  }, {
    "@id" : "rdl:PCA_100003566",
    "@type" : [ "rdl:PCA_100003555", "owl:NamedIndividual", "owl:Class" ],
    "PCA_100000510" : "rdl:PCA_100003721",
    "symbol" : "A",
    "label" : "area",
    "subClassOf" : [ "_:b1", "_:b2", "_:b0", "lis:PhysicalQuantity" ],
    "exactMatch" : [ "http://sandbox.dexpi.org/informationmodel/PhysicalQuantityTypeArea", "http://qudt.org/vocab/quantitykind/Area", "rdl:CFIHOS-45000026", "om:Area", "pca:RDS349874" ]
  } ],
  "@context" : {
    "hasValue" : {
      "@id" : "http://www.w3.org/2002/07/owl#hasValue",
      "@type" : "@id"
    },
    "onProperty" : {
      "@id" : "http://www.w3.org/2002/07/owl#onProperty",
      "@type" : "@id"
    },
    "allValuesFrom" : {
      "@id" : "http://www.w3.org/2002/07/owl#allValuesFrom",
      "@type" : "@id"
    },
    "PCA_100000510" : {
      "@id" : "http://rds.posccaesar.org/ontology/plm/rdl/PCA_100000510",
      "@type" : "@id"
    },
    "subClassOf" : {
      "@id" : "http://www.w3.org/2000/01/rdf-schema#subClassOf",
      "@type" : "@id"
    },
    "symbol" : {
      "@id" : "http://www.ontology-of-units-of-measure.org/resource/om-2/symbol"
    },
    "exactMatch" : {
      "@id" : "http://www.w3.org/2004/02/skos/core#exactMatch",
      "@type" : "@id"
    },
    "label" : {
      "@id" : "http://www.w3.org/2000/01/rdf-schema#label"
    },
    "@vocab" : "http://www.semanticweb.org/owl/owlapi/turtle#",
    "o-rdfs" : "http://tpl.ottr.xyz/rdfs/0.1/",
    "owl" : "http://www.w3.org/2002/07/owl#",
    "xsd" : "http://www.w3.org/2001/XMLSchema#",
    "skos" : "http://www.w3.org/2004/02/skos/core#",
    "rdfs" : "http://www.w3.org/2000/01/rdf-schema#",
    "rstr" : "http://tpl.ottr.xyz/owl/restriction/0.1/",
    "pca" : "http://data.posccaesar.org/rdl/",
    "sd" : "http://www.w3.org/ns/sparql-service-description#",
    "o-docttr" : "http://tpl.ottr.xyz/p/docttr/0.1/",
    "listpl" : "http://rds.posccaesar.org/ontology/lis14/tpl/0.1/",
    "lis12" : "http://standards.iso.org/iso/15926/ontology/life-cycle-integration/",
    "xml" : "http://www.w3.org/XML/1998/namespace",
    "lis" : "http://rds.posccaesar.org/ontology/lis14/rdl/",
    "ottr" : "http://ns.ottr.xyz/0.4/",
    "o-owl-ma" : "http://tpl.ottr.xyz/owl/macro/0.1/",
    "dcterms" : "http://purl.org/dc/terms/",
    "vann" : "http://purl.org/vocab/vann/",
    "plmtpl" : "http://rds.posccaesar.org/ontology/plm/tpl/0.1/",
    "prov" : "http://www.w3.org/ns/prov#",
    "foaf" : "http://xmlns.com/foaf/0.1/",
    "om" : "http://www.ontology-of-units-of-measure.org/resource/om-2/",
    "reqtpl" : "http://w3id.org/requirement-ontology/tpl/0.1/",
    "req" : "https://w3id.org/requirement-ontology/rdl/",
    "void" : "http://rdfs.org/ns/void#",
    "pav" : "http://purl.org/pav/",
    "o-rdf" : "http://tpl.ottr.xyz/rdf/0.1/",
    "dcmitype" : "http://purl.org/dc/dcmitype/",
    "orcid" : "https://orcid.org/",
    "lis2" : "http://rds.posccaesar.org/2008/02/OWL/ISO-15926-2_2003#",
    "ntpl" : "http://norsok.org/templates/",
    "ex" : "http://example.org/",
    "rdf" : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
    "o-owl-dec" : "http://tpl.ottr.xyz/owl/declaration/0.1/",
    "o-owl-re" : "http://tpl.ottr.xyz/owl/restriction/0.1/",
    "rdl" : "http://rds.posccaesar.org/ontology/plm/rdl/",
    "obo" : "http://purl.obolibrary.org/obo/",
    "rrdl" : "http://w3id.org/readi/rdl/",
    "o-owl-ax" : "http://tpl.ottr.xyz/owl/axiom/0.1/",
    "dc" : "http://purl.org/dc/elements/1.1/"
  }
}

3 A DESCRIBE query via the resource label

We can use variables in a DESCRIBE query. The following query asks for a description of resources named “centimetre”.

By convention, names in RDF graphs and OWL ontologies are assigned using the rdfs:label property. We include the RDFS prefix in the query for readability.
# select triples that describe anything named "centimetre"
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
describe ?x
{
  ?x rdfs:label "centimetre"
}

Results:


rdl:PCA_100003663  a     owl:NamedIndividual , lis:Scale ;
        a                [ a                  owl:Restriction ;
                           owl:allValuesFrom  rdl:PCA_100003611 ;
                           owl:onProperty     [ owl:inverseOf  lis:datumUOM ]
                         ] ;
        rdfs:label       "centimetre" ;
        om:symbol        "cm" ;
        skos:exactMatch  om:centimetre , <http://sandbox.dexpi.org/informationmodel/ScaleCentimetre> , <http://qudt.org/vocab/unit/CentiM> , pca:RDS1318004 .

4 A DESCRIBE query to show cross-referenced entities

Again using variables, the following query goes a step further. We look for any lis:Scale with “calorie” in the name, and ask to see those resources that it cross references.

In the PLM-RDL ontologies, cross-references to external ontologies and vocabularies are represented using the SKOS vocabulary – specifically, the mapping properties (skos:closeMatch, skos:exactMatch, etc.).

Note that prefixes for RDF, OWL, and ISO 15926-14 have been added here. In the clause saying ?x a lis:Scale, the “a" is an abbreviation for rdf:type, so that prefix should be included. See the SPARQL specification for a description of string matching with regex.

# select triples cross-referenced from "calorie ..."
PREFIX rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs:  <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:  <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
PREFIX lis: <http://rds.posccaesar.org/ontology/lis14/rdl/>
describe ?y
{
  ?x a lis:Scale ;
    rdfs:label ?x_label .
  filter ( regex( ?x_label, "^calorie") )
  ?x skos:closeMatch|skos:exactMatch|skos:narrowMatch|skos:relatedMatch ?y
}

Results:


pca:RDS431659050  a         rdl:PCA_100001503 , owl:NamedIndividual ;
        rdfs:comment        "External RDL entity" ;
        rdfs:isDefinedBy    rdl:PCA_100002003 ;
        rdfs:label          "CALORIE (PCA RDL concept)" ;
        dcterms:identifier  "http://data.posccaesar.org/rdl/RDS431659050" .

om:calorie-Thermochemical
        a                   rdl:PCA_100003772 , owl:NamedIndividual ;
        rdfs:comment        "External RDL entity" ;
        rdfs:isDefinedBy    rdl:PCA_100003770 ;
        rdfs:label          "calorie (thermochemical) (OM concept)" ;
        dcterms:identifier  "http://www.ontology-of-units-of-measure.org/resource/om-2/calorie-Thermochemical" .

<http://qudt.org/vocab/unit/CAL_MEAN>
        a                   rdl:PCA_100003772 , owl:NamedIndividual ;
        rdfs:comment        "External RDL entity" ;
        rdfs:isDefinedBy    rdl:PCA_100003771 ;
        rdfs:label          "Calorie (mean) (QUDT concept)" ;
        dcterms:identifier  "http://qudt.org/vocab/unit/CAL_MEAN" .