1 / 16

Introduction to Protégé for Absolute Beginners

Introduction to Protégé for Absolute Beginners. University at Buffalo August 11 & 12. SPARQL Protocol and RDF Query Language. SPARQL – SPARQL Protocol and RDF Query Language. A query language that is able to retrieve and manipulate data stored in RDF format.

Download Presentation

Introduction to Protégé for Absolute Beginners

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to Protégé for Absolute Beginners University at Buffalo August 11 & 12

  2. SPARQL Protocol and RDF Query Language

  3. SPARQL – SPARQL Protocol and RDF Query Language • A query language that is able to retrieve and manipulate data stored in RDF format. • On 15 January 2008, SPARQL 1.0 became an official W3C Recommendation • A new version of SPARQL, 1.1 is under review ending on August 21, 2012

  4. SPARQL Graph Matching ?

  5. The Structure of a Basic SPARQL Query • The select clause lists the information you want to see. • For example: player, token • The where clause is a set of statements that pulls the information • For example: player represented by token

  6. Key Terms for Use in Queries • rdfs:subClassOf will return the direct subclasses of another class • rdfs:subClassOf* will return the recursive subclasses of another class • rdf:type will return or set the class/kind of an instance • Prefixes: PREFIX mnply:<http://www.cubrc.org/ontologies/MonopolyOntology#> PREFIX game1:<http://www.cubrc.org/ontologies/MonopolyOntologies/Game1#>

  7. Example Queries • Return all players SELECT ?player WHERE { ?player rdf:typemnply:MonopolyPlayer . } • Return all players and their game tokens SELECT ?player ?token WHERE { ?player mnply:represented_by ?token . }

  8. Example Queries • The previous query made impervious to changes by adding types SELECT ?player ?token WHERE { ?player rdf:typemnply:MonopolyPlayer . ?token rdf:typemnply:MonopolyToken . ?player mnply:represented_by ?token . } • Return all the events a given player participates in SELECT ?event WHERE { ?event rdf:typemnply:MonopolyEvent . ?event mnply:has_participant game1:MonopolyPlayer_1. }

  9. Example Queries • Return all the dice rolls along with whether or not they were doubles SELECT ?roll ?double WHERE { ?roll rdf:typemnply:MonopolyRollOfDice . ?double mnply:assessed_at ?roll . ?double rdf:typemnply:MonopolyDoubles} . } • The above returned just the doubles, to get all the rolls use the OPTIONAL keyword SELECT ?roll ?double WHERE { ?roll rdf:typemnply:MonopolyRollOfDice . OPTIONAL {?double mnply:assessed_at ?roll . ?double rdf:typemnply:MonopolyDoubles} . }

  10. Example Queries • Return all the locations of a player in “temporal” order SELECT ?ordval ?round ?turn ?location WHERE { ?attribute mnply:attribute_of game1:MonopolyPlayer_1 . ?attribute mnply:located_at ?location . ?attribute mnply:assessed_at ?turn . ?turn mnply:occurs_during ?round . ?round mnply:has_ordinal_value ?ordval . } ORDER BY ?ordval

  11. Example Queries • What were the locations of all players at the end of Round 11? SELECT ?player ?round ?turn ?location WHERE { ?player rdf:typemnply:MonopolyPlayer . ?attribute mnply:attribute_of ?player . ?attribute mnply:located_at ?location . ?attribute mnply:assessed_at ?turn . ?turn mnply:occurs_during ?round . ?round mnply:has_ordinal_value 11 . }

  12. Example Queries • What were player 1’s locations at the end of Rounds 11 and 20? SELECT ?player ?round ?turn ?location WHERE { { ?attribute mnply:attribute_of game1:MonopolyPlayer_1 . ?attribute mnply:located_at ?location . ?attribute mnply:assessed_at ?turn . ?turn mnply:occurs_during ?round . ?round mnply:has_ordinal_value 11 . } UNION { ?attribute mnply:attribute_of game1:MonopolyPlayer_1 . ?attribute mnply:located_at ?location . ?attribute mnply:assessed_at ?turn . ?turn mnply:occurs_during ?round .?round mnply:has_ordinal_value 20} . } }

  13. Example Queries • Return the number of each type of equipment used in the game SELECT ?equipmenttype (COUNT(?equipment) AS ?equipmentcount) WHERE { ?equipmenttyperdfs:subClassOfmnply:MonopolyEquipment . ?equipment rdf:type ?equipmenttype . ?attribute mnply:attribute_of ?player . ?attribute mnply:located_at game1:MonopolyBoardwalk_Instance_1 . } GROUP BY ?equipmenttype

  14. Miscellaneous Technologies

  15. Ontofox • OntoFox is a web-based system to support ontology reuse. It allows users to input terms, fetch selected properties, annotations, and certain classes of related terms from source ontologies and save the results using the RDF/XML serialization of the OWL. • http://ontofox.hegroup.org/

  16. (One way of) Using Ontofox • Identify an ontology from which you wish to extract terms • (e.g. Environment Ontology http://purl.bioontology.org/ontology/ENVO ) • Get the full id of the lowest level terms • (e.g. http://purl.obolibrary.org/obo/ENVO_00002021 • http://purl.obolibrary.org/obo/ENVO_00002022, etc. • Get the full id of the highest level term • (http://purl.obolibrary.org/obo/ENVO_00002297) • Select a setting for retrieving intermediate terms • (e.g. IncludeAllIntermediates) • Input URI for annotations to be selected • (e.g. http://www.w3.org/2000/01/rdf-schema#label) • Enter a URI for the output file • (e.g. http://purl.obolibrary.org/obo/external/ENVO_extract.owl)

More Related