{{{ #!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 == (write here) == Using the reified ISO 15926-2 endpoint == '''To execute the following scripts, go to the [http://rdswip.ids-adi.org/presentation/search/rds-sparql.html RDS/WIP query test page]. === Taxonomy === ==== 1. Get me all the subclasses of PUMP, in a table ==== If you wish to see what this returns right away, just [http://rdswip.posccaesar.org/servlets/pcardl?query=PREFIX+owl%3A+%0D%0APREFIX+rdf%3A+%0D%0APREFIX+rdfs%3A+%0D%0APREFIX+xsd%3A+%0D%0APREFIX+rdl%3A+%0D%0APREFIX+part2%3A+%0D%0APREFIX+base%3A+%0D%0APREFIX+dc%3A+%0D%0APREFIX+rdswip%3A+%0D%0ASELECT+%0D%0A++%3FsubclassIdPCA+%3FsubclassDesignation+%0D%0A++%3FsuperclassIdPCA+%3FsuperclassDesignation%0D%0AWHERE+%0D%0A{%0D%0A++%3Fspecialization+part2%3AhasSuperclass+%3Fsuperclass+.%0D%0A++%3Fspecialization+part2%3AhasSubclass+%3Fsubclass+.%0D%0A++%3Fsubclass+rdswip%3AhasIdPCA+%3FsubclassIdPCA+.%0D%0A++%3Fsubclass+rdswip%3AhasDesignation+%3FsubclassDesignation+.%0D%0A++%3Fsuperclass+rdswip%3AhasIdPCA+%3FsuperclassIdPCA+.%0D%0A++%3Fsuperclass+rdswip%3AhasDesignation+%3FsuperclassDesignation+.%0D%0A++%3Fsuperclass+rdswip%3AhasDesignation+"PUMP"++%0D%0A}%0D%0Alimit+100&stylesheet=xml-to-html.xsl click here] to submit the query to the RDS/WIP. {{{ PREFIX owl: PREFIX rdf: PREFIX rdfs: PREFIX xsd: PREFIX rdl: PREFIX part2: PREFIX base: PREFIX dc: PREFIX rdswip: SELECT ?subclassIdPCA ?subclassDesignation ?superclassIdPCA ?superclassDesignation WHERE { ?specialization part2:hasSuperclass ?superclass . ?specialization part2:hasSubclass ?subclass . ?subclass rdswip:hasIdPCA ?subclassIdPCA . ?subclass rdswip:hasDesignation ?subclassDesignation . ?superclass rdswip:hasIdPCA ?superclassIdPCA . ?superclass rdswip:hasDesignation ?superclassDesignation . ?superclass rdswip: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://rdswip.ids-adi.org/servlets/pcardl?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+rdl%3A+%3Chttp%3A%2F%2Frds.posccaesar.org%2F2008%2F06%2FOWL%2FRDL%23%3E%0D%0APREFIX+part2%3A+%3Chttp%3A%2F%2Frds.posccaesar.org%2F2008%2F02%2FOWL%2FISO-15926-2_2003%23%3E%0D%0APREFIX+base%3A+%3Chttp%3A%2F%2Frds.posccaesar.org%2F2008%2F06%2FOWL%2FRDL%3E%0D%0APREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0D%0APREFIX+rdswip%3A+%3Chttp%3A%2F%2Frdswip.ids-adi.org%2Fservlets%2Fpcardl%23%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+part2%3AhasSuperclass+%3Fsuperclass+.%0D%0A++%3Fspecialization+part2%3AhasSubclass+%3Fsubclass+.%0D%0A++%3Fsubclass+rdswip%3AhasIdPCA+%3FsubclassIdPCA+.%0D%0A++%3Fsubclass+rdswip%3AhasDesignation+%3FsubclassDesignation+.%0D%0A++%3Fsuperclass+rdswip%3AhasIdPCA+%3FsuperclassIdPCA+.%0D%0A++%3Fsuperclass+rdswip%3AhasDesignation+%3FsuperclassDesignation+.%0D%0A++%3Fsuperclass+rdswip%3AhasDesignation+%22PUMP%22++%0D%0A}%0D%0Alimit+100&stylesheet=xml-to-html.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 rdl: PREFIX part2: PREFIX base: PREFIX dc: PREFIX rdswip: 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 part2:hasSuperclass ?superclass . ?specialization part2:hasSubclass ?subclass . ?subclass rdswip:hasIdPCA ?subclassIdPCA . ?subclass rdswip:hasDesignation ?subclassDesignation . ?superclass rdswip:hasIdPCA ?superclassIdPCA . ?superclass rdswip:hasDesignation ?superclassDesignation . ?superclass rdswip:hasDesignation "PUMP" } limit 100 }}} ----