{{{ #!comment NB! Make sure that you follow the guidelines: http://trac.posccaesar.org/wiki/IdsAdiEditing }}} [[TracNav(TracNav/RdsWip)]] [[Image(wiki:IdsAdiBranding:Logo-128x128.gif)]] = POSC-Caesar FIATECH IDS-ADI Projects = == Intelligent Data Sets Accelerating Deployment of ISO15926 == == ''Realizing Open Information Interoperability'' == ---- = RDS/WIP sample queries in SPARQL = [[PageOutline(3-4,Contents,inline)]] == Using the OWL/RDF native endpoint == The triplestores that hold the OWL/RDF content of the RDS/WIP have protocol endpoints conforming to the [http://www.w3.org/TR/rdf-sparql-protocol/ SPARQL Protocol Recommendation] from the W3C. To query it using SPARQL clients, just enter the service URI of the endpoint you're interested in, for example: [http://rdl.rdlfacade.org/data] is the URI of the endpoint containing classifications outside of the base part 2 data model. (@todo consider use of word base here versus core) == Using the PCA RDL endpoint == '''To execute the following scripts, go to the [http://rdl.rdlfacade.org/data?info=&search=&sparql=1 PCA RDL SPARQL query page]. These scripts are currently demonstrated against the PCA RDL endpoint, which represents ISO 15926 definitions in a form closely related to the evolving RDS/WIP form - they give some idea of the possibilities when using SPARQL with ISO 15926. === Taxonomy === ==== 1. Get me all the subclasses of PUMP, in a table ==== If you wish to see what this returns right away, just [http://rdl.rdlfacade.org/data?query=PREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0D%0APREFIX+dm%3A+%3Chttp%3A%2F%2Fdm.rdlfacade.org%2Fdata%23%3E%0D%0APREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0D%0APREFIX+rdl%3A+%3Chttp%3A%2F%2Frds.posccaesar.org%2F2008%2F06%2FOWL%2FRDL%23%3E%0D%0APREFIX+base%3A+%3Chttp%3A%2F%2Frdl.rdlfacade.org%2Fdata%3E%0D%0ASELECT+%0D%0A++%3FsubclassIdPCA+%3FsubclassDesignation+%0D%0A++%3FsuperclassIdPCA+%3FsuperclassDesignation%0D%0AWHERE+%0D%0A{%0D%0A++%3Fspecialization+dm%3AhasSuperclass+%3Fsuperclass+.%0D%0A++%3Fspecialization+dm%3AhasSubclass+%3Fsubclass+.%0D%0A++%3Fsubclass+rdl%3AhasIdPCA+%3FsubclassIdPCA+.%0D%0A++%3Fsubclass+rdl%3AhasDesignation+%3FsubclassDesignation+.%0D%0A++%3Fsuperclass+rdl%3AhasIdPCA+%3FsuperclassIdPCA+.%0D%0A++%3Fsuperclass+rdl%3AhasDesignation+%3FsuperclassDesignation+.%0D%0A++%3Fsuperclass+rdl%3AhasDesignation+%22PUMP%22++%0D%0A}%0D%0ALIMIT+100%0D%0A%09%09%09%09%09%09&stylesheet=%2Fpresentation%2Fscripts%2Fmain%2Fsparql-presentation.xsl click here] to submit the query to the RDS/WIP. {{{ PREFIX owl: PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX dm: PREFIX dc: PREFIX rdl: PREFIX base: SELECT ?subclassIdPCA ?subclassDesignation ?superclassIdPCA ?superclassDesignation WHERE { ?specialization dm:hasSuperclass ?superclass . ?specialization dm:hasSubclass ?subclass . ?subclass rdl:hasIdPCA ?subclassIdPCA . ?subclass rdl:hasDesignation ?subclassDesignation . ?superclass rdl:hasIdPCA ?superclassIdPCA . ?superclass rdl:hasDesignation ?superclassDesignation . ?superclass rdl:hasDesignation "PUMP" } LIMIT 100 }}} ==== 2. Get me all subclasses of PUMP, in a typical OWL format ==== The following query serves to extract a (tiny) subset of the Reference Data Library, returning RDF data with `rdfs:label` applied for the names of the reference entitites. To see the output right away, [http://rdl.rdlfacade.org/data?query=PREFIX+owl%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%3E%0D%0APREFIX+rdf%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%3E%0D%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0D%0APREFIX+xsd%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%3E%0D%0APREFIX+dm%3A+%3Chttp%3A%2F%2Fdm.rdlfacade.org%2Fdata%23%3E%0D%0APREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0D%0APREFIX+rdl%3A+%3Chttp%3A%2F%2Frds.posccaesar.org%2F2008%2F06%2FOWL%2FRDL%23%3E%0D%0APREFIX+base%3A+%3Chttp%3A%2F%2Frdl.rdlfacade.org%2Fdata%3E%0D%0ACONSTRUCT%0D%0A{%0D%0A++rdl%3ARDL_Fragment_Test+a+owl%3AOntology+.%0D%0A++%3Fsubclass+a+owl%3AClass+.%0D%0A++%3Fsuperclass+a+owl%3AClass+.%0D%0A++%3Fsubclass+rdfs%3AsubClassOf+%3Fsuperclass+.%0D%0A++%3Fsubclass+rdfs%3Alabel+%3FsubclassDesignation+.%0D%0A++%3Fsuperclass+rdfs%3Alabel+%3FsuperclassDesignation+.%0D%0A}%0D%0AWHERE+%0D%0A{%0D%0A++%3Fspecialization+dm%3AhasSuperclass+%3Fsuperclass+.%0D%0A++%3Fspecialization+dm%3AhasSubclass+%3Fsubclass+.%0D%0A++%3Fsubclass+rdl%3AhasIdPCA+%3FsubclassIdPCA+.%0D%0A++%3Fsubclass+rdl%3AhasDesignation+%3FsubclassDesignation+.%0D%0A++%3Fsuperclass+rdl%3AhasIdPCA+%3FsuperclassIdPCA+.%0D%0A++%3Fsuperclass+rdl%3AhasDesignation+%3FsuperclassDesignation+.%0D%0A++%3Fsuperclass+rdl%3AhasDesignation+%22PUMP%22++%0D%0A}%0D%0Alimit+100&stylesheet=%2Fpresentation%2Fscripts%2Fmain%2Fsparql-presentation.xsl click here]. If you save the resulting page from your browser to a file, say `pumps.owl`, you can load it in an OWL application, such as the on-line [http://pellet.owldl.com/owlsight/ OwlSight] or the [http://protege.stanford.edu/ Protégé] editor. {{{ PREFIX owl: PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX dm: PREFIX dc: PREFIX rdl: PREFIX base: CONSTRUCT { rdl:RDL_Fragment_Test a owl:Ontology . ?subclass a owl:Class . ?superclass a owl:Class . ?subclass rdfs:subClassOf ?superclass . ?subclass rdfs:label ?subclassDesignation . ?superclass rdfs:label ?superclassDesignation . } WHERE { ?specialization dm:hasSuperclass ?superclass . ?specialization dm:hasSubclass ?subclass . ?subclass rdl:hasIdPCA ?subclassIdPCA . ?subclass rdl:hasDesignation ?subclassDesignation . ?superclass rdl:hasIdPCA ?superclassIdPCA . ?superclass rdl:hasDesignation ?superclassDesignation . ?superclass rdl:hasDesignation "PUMP" } limit 100 }}} ----