Writing SPARQL queries for OWL ontologies can be time-consuming for those who do not do it everyday. Therefore, Mark Schneider has built a handy language, allowing users querying using OWL syntax -- SPARQLAS. These queries are translated into SPARQL queries that can be executed in a SPARQL engine that supports the OWL DL entailment regime, e.g., pellet.
The syntax is simple: You use the OWL Functional Syntax or a shortened version of it, and you can use variables wherever you have an entity (Class, Datatype, ObjectProperty, DataProperty, NamedIndividual) or a literal. You can construct nested expressions that use these variables.
Example
All subclasses of pizza that have as topping some topping with spiciness hot.
In SPARQLAS OWL Functional Syntax:
Namespace ( = <http://www.co-ode.org/ontologies/pizza/pizza.owl#> )
Query (
SubClassOf ( ?x ObjectIntersectionOf ( Pizza ObjectSomeValuesFrom ( hasTopping ObjectIntersectionOf ( PizzaTopping ObjectSomeValuesFrom ( hasSpiciness Hot ) ) ) ) )
)
In SPARQLAS Shortened Functional Syntax:
Namespace ( = <http://www.co-ode.org/ontologies/pizza/pizza.owl#> )
Query (
SubClassOf ( ?x And ( Pizza Some ( hasTopping And ( PizzaTopping Some (hasSpiciness Hot ) ) ) ) )
)
You can try it in two different ways:
Integrate it in your application
The syntax is simple: You use the OWL Functional Syntax or a shortened version of it, and you can use variables wherever you have an entity (Class, Datatype, ObjectProperty, DataProperty, NamedIndividual) or a literal. You can construct nested expressions that use these variables.
Example
All subclasses of pizza that have as topping some topping with spiciness hot.
In SPARQLAS OWL Functional Syntax:
Namespace ( = <http://www.co-ode.org/ontologies/pizza/pizza.owl#> )
Query (
SubClassOf ( ?x ObjectIntersectionOf ( Pizza ObjectSomeValuesFrom ( hasTopping ObjectIntersectionOf ( PizzaTopping ObjectSomeValuesFrom ( hasSpiciness Hot ) ) ) ) )
)
In SPARQLAS Shortened Functional Syntax:
Namespace ( = <http://www.co-ode.org/ontologies/pizza/pizza.owl#> )
Query (
SubClassOf ( ?x And ( Pizza Some ( hasTopping And ( PizzaTopping Some (hasSpiciness Hot ) ) ) ) )
)
You can try it in two different ways:
- Web: A HTML client with many examples is available on http://twouse.west.uni-koblenz.de/services/sparqlas2sparql.php
- TwoUse Toolkit: The query language is distributed as part of the TwoUse toolkit. More information on http://twouse.googlecode.com/
Integrate it in your application
- Web Service. Translating SPARQLAS into SPARQL is available as web service under http://twouse.west.uni-koblenz.de:8080/services/sparqlas2sparql?wsdl .
- Standalone: The standalone bundle for java is available on http://code.google.com/p/twouse/downloads/list
0 comments:
Post a Comment