SPARQL-DL Test Suite

Using jOWL, and abstract SPARQL-DL syntax.
Supported Query Atoms: Type, PropertyValue, SubClassOf, Thing, Class, ObjectProperty, DatattypeProperty, DirectSubClassOf, DirectType.

Unsupported at the moment: triple (or more) nested combinations:
Type(?w, wine), PropertyValue(?w, hasVintageYear, ?z), PropertyValue(?z, yearValue, ">1980")

Try yourself


Example queries

A-Box Queries
  • owl:Class for the Individual 'Whitehall Lane Primavera'.
    Type(Whitehall Lane Primavera, ?class)
  • All individuals of the class 'white wine'.
    Type(?thing, WhiteWine)
  • All individuals that are of the class 'Burgundy' and 'WhiteWine'.
    Type(?x,burgundy), Type(?x,whitewine)
  • All wines with color Red and flavor moderate.
    Type(?y, wine), PropertyValue(?y, hasColor, red), 
    PropertyValue(?y, hasFlavor, moderate)
  • All 'wines' located in the BordeauxRegion with color red.
    Type(?y, Wine), 
    PropertyValue(?y, locatedIn, BordeauxRegion), 
    PropertyValue(?y, hasColor, red)
  • The same query as above, but formulated differently.
    Type(?y, bordeaux), Type(?y, Redwine)
  • Reasoning with transitivity, all French wines.
    Type(?y, Wine),  PropertyValue(?y, locatedIn, frenchRegion)
  • The color of MariettaCabernetSauvignon.
    PropertyValue(MariettaCabernetSauvignon, hascolor, ?x)
  • All Properties of MariettaCabernetSauvignon.
    PropertyValue(MariettaCabernetSauvignon, ?p, ?x)
  • Datatype Reasoning (from jOWL 0.7).
    • 'VintageYear's with yearValue later than 1980.
      Type(?i, VintageYear), 
      PropertyValue(?i, yearValue, ">1980")
    • 'VintageYear's with yearValue earlier than 1980.
      Type(?i, VintageYear), 
      PropertyValue(?i, yearValue, "<1980")
  • Syntax Extensions
    • All Individuals and their Classes.
      • Faster Query.
        Thing(?i), Type(?i, ?C)
      • Same, but less optimal query (slower on first run)
        Type(?i, ?C), Class(?C)
    • Direct Types of Wine (none).
      DirectType(?i, wine)
    • Queries can also assert certain things:
      • Is Whitehall Lane Primavera a Wine?.
        Type(WhitehallLanePrimavera, wine)
      • Is Whitehall Lane Primavera a dry wine?
        PropertyValue(Whitehall Lane Primavera, hasSugar, dry)
      • Is St Genevieve Texas White a US-Region Wine?
        PropertyValue(StGenevieveTexasWhite, locatedin, USRegion)
T-Box Queries
  • All Object Properties.
    ObjectProperty(?x)
  • All Datatype Properties.
    DatatypeProperty(?x)
  • All SubClasses of Wine.
    SubClassOf(?sc, wine)
  • Syntax Extensions
    • All owl:Classes.
      Class(?x)
    • Extended PropertyValue to work with classes as well: properties for wine.
      PropertyValue(wine, ?p, ?c)

Anatomy of the result object

object.error
If an error occurred, this is where the error message is listed.
object.results
Associative array containing results.
object.assert
True, false or undefined. Indicates whether the query evaluated to true or not. See examples above.
More Examples - jOWL test suite
  • All types of Sauternes, with all their restrictions.
    Type(?t, Sauternes), PropertyValue(?t, ?u, ?v)
  • Properties of SweetRiesling:
    • with value type = Class.
      PropertyValue(sweetriesling, ?y, ?t), Class(?t)
    • with value type = Thing.
      PropertyValue(sweetriesling, ?y, ?t), Thing(?t)
  • Is French Region a Class?
    Class(FrenchRegion)
  • Is Year Value a DatatypeProperty?
    DatatypeProperty(yearvalue)

Results

Querying, Please Stand By
Loading Image

Under Development, David Decraene.
OntologyOnline.org