These pages are deprecated ; please go to the pages of our new team Edelweiss

Corese query language and SPARQL

About Applications Downloads Mailing List Documentation Tutorial Contacts

Corese Query API

Corese corese=new Corese(
    "corese.properties",    // the properties file to customize corese
    "/user/oc/home/data");   // the root dir where to find the RDF documents

RDFResult res = corese.query(
"select ?name where ?x c:name ?name");
String[] var = res.getSelectVar();

for (Enumeration en = res.getValues(); en.hasMoreElements(); ){
   
CoreseGraph cg = (CoreseGraph) en.nextElement();
   
CoreseConcept[] value = cg.getValue(var[0]);
    System.out.println(var[0] + " = " + value[0].getLabel());
}


Corese and SPARQL

Corese interprets SPARQL queries without the following statements :
  • BASE, CONSTRUCT, ASK, DESCRIBE, OFFSET
  • Other Syntactic Forms than simple triples : object list, blanknode _:a [], collection (a b c), factorization of the resource (?x p ?y ; q ?z), as
  • comments
  • function in order by

Corese Goodies

  • Answer SPARQL query with RDFS entailment
  • select group ?x where : group results with same value of ?x
  • select count ?y where : count the number of values of ?y in each result
  • select more where : search approximate result with respect to the RDF Schema
  • ?x prop[n] ?y : search an oriented path of length at most n between two resources
  • ?x prop{n} ?y : search a non oriented path of length at most n between two resources
  • all::prop{n}, all::prop[n] : give all paths
  • ?x direct::rdfs:subClassOf ?y  : ?x is a direct subClassOf ?y

Corese may answer with a more precise RDF statement that asked by the query. For example a subproperty may be returned  as  a solution to a property.


Corese and OWL Lite


Corese interprets a subset of OWL Lite statements according to two modes :

  1. Default
    TransitiveProperty, SymmetricProperty, inverseOf, owl:Class, ObjectProperty, DatatypeProperty

  2. Run the inference engine
    intersectionOf/subClassOf Restriction allValuesFrom