Corese Corese

Corese FAQ

Olivier Corby, INRIA, June 2008.
See also: Corese

How can I create a Corese engine ?

How can I load RDF, RDFS, etc ?

How can I execute a SPARQL query ?

How can I process SPARQL query results ?

SPARQL query does not retrieve an instance given its URI ? an instance of a Class ?

How can I retrieve all the subclasses of a class ?

<owl:TransitiveProperty rdf:about='&rdfs;subClassOf' />

prefix my: <http://www.example.org/ontology#>
select ?sub where {
  ?sub rdfs:subClassOf my:Class
}

Then how can I retrieve the direct subclasses of a class ?

prefix my: <http://www.example.org/ontology#>
select ?sub where {
  ?sub direct::rdfs:subClassOf my:Class
}

How can I retrieve all resources linked to a given resource ?

select ?y where {
  <uri> ?p ?y
}

How can I retrieve all resources linked to a given resource with properties from a given ontology ?

prefix my: <http://www.example.org/ontology#>
select ?y where {
  <uri> ?p ?y
  filter(?p ^ my:)
}

How can I check that a resource is not linked to another resource, by any property ?

prefix my: <http://www.example.org/ontology#>
select ?x where {
  ?x ?p ?y 
  optional {
    ?x ?q <uri>
  }
  filter(! bound(?q))
}

How can I model and query an n-ary relation ?

<rdf:Description rdf:about='#myCar'>
  <my:speed rdf:parseType='Resource'>
     <rdf:value>100</rdf:value>
     <my:unit>km/h</my:unit>
  </my:speed>
</rdf:Description>
prefix my: <http://www.example.org/ontology#>
select ?speed ?unit where {
  ?car my:speed [ rdf:value ?speed ; my:unit ?unit ]
}