460 likes | 627 Views
OntoGrid: Paving the way for Knowledgeable Grid Services and Systems. FP6-511513. www.ontogrid.net. WS-DAIOnt-RDF(S) Hands-on session. Miguel Esteban Gutiérrez (U.P.M.). OntoGrid Semantic Grid Tutorial Manchester, Feb 2007. Outline of the tutorial. Part I: Theoretical introduction
E N D
OntoGrid: Paving the way for Knowledgeable Grid Services and Systems FP6-511513 www.ontogrid.net WS-DAIOnt-RDF(S) Hands-on session Miguel Esteban Gutiérrez (U.P.M.) OntoGrid Semantic Grid Tutorial Manchester, Feb 2007
Outline of the tutorial • Part I: Theoretical introduction • Part II: Hands-on exercises OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Part I: Theoretical introduction OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Outline of the tutorialTheoretical introduction • An introductory scenario • Ontology share/reuse problem • Possible solutions • Our approach • The specification • Foundations • Operational model • The implementation • Architecture • RDF(S) Storage support OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Ontology share/reuse problem ? ? ? ? Kowari ? ? 3Store ? ? OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Possible solutionsAccess through proprietary interfaces API <<A>>::methodXXX() result XXX API <<A>> • The client needs to know the specific APIs of every single source it has to connect to: • Operational model • Data model THIN CLIENT OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Possible solutions (II)Acquire the fulls contents HTTP::get (ontology_url) serialized ontology HTTP • Download overhead: how big is the part of the ontology that will be used? • How often are the ontologies synchronized? THICK CLIENT OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Our approach • Standardise an RDF(S) ontology access mechanism that: • Provides an homogeneus access interface • Defines an operational model based on the model itself • Full CRUD (beyond SPARQL protocol) • Prevents the user from dealing directly with the physical resources (resource virtualization) OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
The specificationWS-DAIOnt-RDF(S)– RDF(S) Access in Grids • Web Services Data Access and Integration – The Ontology Realization for RDF(S) Access • Specification of grid compliant ontology services, which • Defines a set of interfaces for accessing RDF(S) ontologiesin aGrid environment • Provides two ways for accessing ontologies: • Using model-based access functionalities • Using RDF(S) querying languages • Is fully compliant with OGSA • Based on Grid (OGF) and Web Services (OASIS, W3C) standards • WS-DAI, WS-RF, WS-Addressing • Is based on Semantic Web standards (W3C): • RDF, RDFS, SPARQL OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
What is a Grid? R2AD License Webserver Printer Database A grid is a system consisting of • Distributed but connected resources and • Software and/or hardware that provides and manages logically seamless access to those resources to meet desired objectives Handheld Server Supercomputer Workstation Cluster Data Center Taken from Hiro Kishimoto’s keynote in GGF17 OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
The specification (II)The Grid as an ontology deployment playground • EGA Reference Model De-facto standard grid architecture • Open Grid Services Architecture (OGSA) SoA and web services based instantiation of EGA Reference Model • Infrastructure Services (i.e. transactions) • Execution Management Services(i.e. job management) • Data Services • Security • Data Description • Data Access • Storage Resource Management • Cache Services • Data Replication • Data Federation • Metadata Catalogue & Registries • Resource Management Services • Security Services (i.e. AAA) • Self-management Services • Information Services (i.e. provenance) WS-DAI Specification OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
The specification (III)How does the specification fit in WS-DAI Sets general pattern for realisations WS-DAI Extensions for specific kinds of data resource Possible Future Realisations WS-DAIOnt-RDF(S) WS-DAIR WS-DAIX Ontology Ops Query lang. Relational SQL XML XQuery/XPath OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
The specification (II)Data resources OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
The specification (III)Interface organization OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
RDFSRepositorySelectorService OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
RDFSRepositoryService OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
RDFSClassService OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
The Implementation Architecture • Two-tier architecture: • Web Service tier, different layers according access granularity • Upper layer: management of multiple repositories • Intermediate layer: management of a single repository • Lower layer: management of knowledge elements of a given repository • RDF(S) access tier: • Abstracts the interaction with specific RDF(S) storages OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Part II: Hands-on exercises OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Outline of the tutorialHands-on exercises • Methodology • Introducing the players • The software distribution • The sample ontologies • Hands-on work lifecycle overview • Setting up the work environment • Pre-deployment configuration • Prototype services deployment • Post-deployment configuration • Using the services • The repository selector service • The repository service • The class service • Advanced use of the services • Cleaning up OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Methodology • The software will be used in two ways: • Command line clients • Ad-hoc Java clients • The clients will be tested in a controlled scenario: • The scenario will be prepared as part of the practical • The resources will be configured • The services will be deployed in the container • When the practical ends, the alumni will clean up their computer • The services will be undeployed from the container • Two console windows will be necessary: • Client window • Container window OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Setting up the work environment (I)Preparing the resources • Download the resources: • Software: already downloaded yesterday • Ontologies: http://www.cs.man.ac.uk/~ocorcho/OntoGrid/SG-tutorial/software/backoffice.zip • Unpack the resources: • The directory where the software was unpacked to will be referred to as %DIST% • The directory where the ontologies will be unpacked to will be referred to as %BACKOFFICE% OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Introducing the players (I)The software distribution • Software:ws-daio-rdfs.v0.5.zip(sg-tutorial-install.zip) • Structure: OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Introducing the players (II)The sample ontologies • Sample ontologies:backoffice.zip • Main ontology used: • Insurance Grid Ontology (insurance_grid.rdfs) • Class hierarchy: OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Hands-on work lifecycle overview OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Setting up the work environment (II)Pre-deployment configuration: How to configure the repositoy selector service RDFSNamespace uri has SC RDFSSesameRepository SC SC SC RDFSSesameFileRepository file RDFSSesameMemoryRepository RDFSSesameRemoteRepository user password SC SC RDFSSesameHTTPRepository url RDFSSesameRMIRepository rmiuri RDFSRepository log • More RDF(S) Repositories here to be added • For example: • Jena RDF(S) storage • Oracle-RDF • RDF distributed systems (ATLAS) OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Setting up the work environment (III)Pre-deployment configuration: How to configure the repositoy selector service(II) <?xml version="1.0" encoding="WINDOWS-1252"?> <rdf:RDF xmlns:rdfs_repos="http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> <rdf:Description rdf:about="http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#insurance_grid"> <rdfs:comment>The Insurance Grid Ontology</rdfs:comment> <rdfs:label>insurance_grid</rdfs:label> <rdfs_repos:has rdf:resource="http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#ig_ns"/> <rdfs_repos:file>D:/2ndreview/backoffice/insurance_grid.rdfs</rdfs_repos:file> <rdf:type rdf:resource="http://wsdaiordfs.eu.ist.ontogrid/ RDFSRepository#RDFSSesameFileRepository"/> </rdf:Description> <rdf:Description rdf:about="http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#ig_ns"> <rdfs:comment>The Insurance Grid Ontology Namespace</rdfs:comment> <rdfs:label>ig_ns</rdfs:label> <rdfs_repos:uri>http://www.insurancegrid.org/vocabulary#</rdfs_repos:uri> <rdf:type rdf:resource="http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#RDFSNamespace"/> </rdf:Description> </rdf:RDF> "http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#insurance_grid" "http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#ig_ns" D:/2ndreview/backoffice/insurance_grid.rdfs "http://wsdaiordfs.eu.ist.ontogrid/ RDFSRepository#RDFSSesameFileRepository" "http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#ig_ns" http://www.insurancegrid.org/vocabulary# "http://wsdaiordfs.eu.ist.ontogrid/RDFSRepository#RDFSNamespace" OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Setting up the work environment (III)Pre-deployment configuration: Configuring the repositories that are to be used (II) • Configure the repositories that will be managed by the selector service: (at least insurance_grid.rdfs) • Create a file named RDFSRepository.rdf in %DIST%/etc • Create a repository description for the default ontology that we will use: • Name: insurance_grid • File: insurance_grid.rdfs • Log: <<any you want>> • Namespace uri: http://www.insurancegrid.org/vocabulary# • Include other repository descriptions for any extra repository that you want to use. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Setting up the work environment (IV)Build • Build the prototype: > ant all OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Setting up the work environment (V)Deploy • Deploy the services: > ant deploy OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Setting up the work environment (VI)Running the container & further configuration • Starting the container (Container window) > globus-start-container -nosec • Post-deployment configuration (Client window) • Set up some helpful environment variables > set %SELECTOR%=\ http://localhost:8080/wsrf/services/WS-DAIO-RDFS/RDFSRepositorySelectorService > set %REPOSITORY%=\ http://localhost:8080/wsrf/services/WS-DAIO-RDFS/RDFSRepositoryService > set %CLASS%=\ http://localhost:8080/wsrf/services/WS-DAIO-RDFS/RDFSClassService > set %NS%=http://www.insurancegrid.org/vocabulary# • Set up GT4 environment > globus-devel-env OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (I) – The Repository Selector Service • Check out how many repositories are available > get-number-of-repositories -s %SELECTOR% There are n repositories available in the backoffice directory managed by the selector. • List the names of the available repositories > list-repositories -s %SELECTOR% The name of each of the repositories managed by the selector will be returned. • Retrieve an available repository > get-repository -s %SELECTOR% insurance_grid repository.rdfs The repository is retrieved and stored in the specified file in RDF/XML . • Load an available repository > load-repository -s %SELECTOR% insurance_grid The service returns the EPR of the repository service to which we have to contact in order to access to the specified repository. The EPR is serialized to a file that will be used in the following examples. It will be referred to as <EPR_REPOSITORY>. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (II) – The Repository Service • List the available classes in the repository: > list-classes -e <EPR_REPOSITORY> The service returns all the available classes defined in the repository, plus those predefined by RDFS. • Load an available class from the repository: > load-class -e <EPR_REPOSITORY> %NS%#Company > load-class -e <EPR_REPOSITORY> %NS%#PhysicalActor The service returns the EPR of the class service to which we have to contact in order to access to the specified classes. The EPR to access to the Company class will be referred to as <EPR_CLASS_1>, and the EPR to access the PhysicalActor class will be referred to as <EPR_CLASS_2>. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (III) – The Class Service (I) • List the direct subclasses of a class: > list-related-classes -e <EPR_CLASS_1> -lr subclasses The result is the direct subclasses of the class, that is, those which appear as subject in a rdfs:subClassOf relationship which has as object the class represented by the service. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (IV) – The Class Service (II) • List direct superclasses of a class: > list-related-classes -e <EPR_CLASS_1> -lr superclasses The result is the direct superclasses of the class, that is, those which appear as object in a rdfs:subClassOf relationship which has as subject the class represented by the service. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (V) – The Class Service (III) • List of the subclasses of a class: > list-related-classes -e <EPR_CLASS_1> -lr subclasses -chr The result is all the subclasses of the class, that is, those classes which are direct subclasses or have a subclass that is direct subclass of the class represented by the service OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (VI) – The Class Service (IV) • List of the superclasses of a class: > list-related-classes -e <EPR_CLASS_1> -lr superclasses -chr The result is all the superclasses of the class, that is, those which are direct superclasses or have a superclass that is direct superclass of the class represented by the service OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (VII) – The Class Service (V) • List of the siblings of the class: > list-related-classes -e <EPR_CLASS_1> -lr siblings The result is the sibling classes of the class, that is, those have the same direct superclasses than the class represented by the service. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (VIII) – The Class Service (VI) • List the direct subclasses of a class: > list-related-classes -e <EPR_CLASS_2> -lr subclasses The result is the direct subclasses of the class, that is, those which appear as subject in a rdfs:subClassOf relationship which has as object the class represented by the service. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (IX) – The Class Service (VII) • List direct superclasses of a class: > list-related-classes -e <EPR_CLASS_2> -lr superclasses The result is the direct superclasses of the class, that is, those which appear as object in a rdfs:subClassOf relationship which has as subject the class represented by the service. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (X) – The Class Service (VIII) • List of the subclasses of a class: > list-related-classes -e <EPR_CLASS_2> -lr subclasses -chr The result is all the subclasses of the class, that is, those classes which are direct subclasses or have a subclass that is direct subclass of the class represented by the service OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (XI) – The Class Service (IX) • List of the superclasses of a class: > list-related-classes -e <EPR_CLASS_2> -lr superclasses -chr The result is all the superclasses of the class, that is, those which are direct superclasses or have a superclass that is direct superclass of the class represented by the service OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (XII) – The Class Service (X) • List of the siblings of the class: > list-related-classes -e <EPR_CLASS_2> -lr siblings The result is the sibling classes of the class, that is, those have the same direct superclasses than the class represented by the service. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (XIII) – The Repository Service (III) • Execute a simple graph query defined different query languages: > execute-query -e <EPR_REPOSITORY> -ql rql class_query.rql > execute-query -e <EPR_REPOSITORY> -ql rdql class_query.rdql > execute-query -e <EPR_REPOSITORY> -ql serql class_query.serql The simple query used selects the classes defined in the repository: • RQL: class • RDQL: SELECT ?x WHERE (?x <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2000/01/rdf-schema#Class>) • SERQL: SELECT DISTINCT C FROM {C} rdf:type {rdfs:Class} As expected, the three queries have the same results: the classes defined in the repository plus the predefined by RDFS. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Using the services (XIV) – The Repository Service (IV) • Execute a simple construct query in SERQL The query creates an ad-hoc S ex:superclassOf C relationship between each two classes S and C such as C rdfs:subClassOf S holds: CONSTRUCT {S} ex:superClassOf {C} FROM {C} rdf:type {rdfs:Class}; rdfs:subClassOf {S} USING NAMESPACE ex = <http://example.org/things#> • Using the graph querying interface: > execute-query -e <EPR_REPOSITORY> -ql serql construct.serql In this case the results are returned in a table, as happened with the previous queries. • Using the construct query interface: > execute-construct-query -e <EPR_REPOSITORY> -ql serql construct.serql construct.result.rdfs In this case the results are stored serialized in RDF/XML in an specified file. OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007
Cleaning up • Before moving to the next session, clean the container :-D > cd %DIST% > ant undeploy OntoGrid Semantic Grid Tutorial - Manchester, Feb 2007