fr.inria.acacia.corese.api
Interface IEngine


public interface IEngine

This class encapsulate the Corese class, which manages the Corese RDF engine

Author:
Virginie Bottollier

Field Summary
static java.lang.String ENGINE_DEBUG
          If true, prints a maximum of information about the inferences it is making
Values: true or false
static java.lang.String ENGINE_GUI_NAMESPACE
          Predefined prefix associated with a namespace
Example: "a http://www.inria.fr/acacia# i http://www.inria.fr#"
static java.lang.String ENGINE_PROJECTION_MAX
          Maximum number of projections computed to answer a query
Values: Integer
static java.lang.String ENGINE_RESULT_JOIN
          When this property is set to true, Corese groups projections that share the same first concept into one result.
static java.lang.String ENGINE_RESULT_MAX
          Maximum number of result returned after possibly grouping projections
Values: Integer
static java.lang.String ENGINE_SHOW_MAX
          Maximum number of statements printed by the RDF pretty printer
Values: Integer
static java.lang.String ENGINE_SOURCE_REGEX
          If a URL of a document that contains a graph matches a given pattern, this graph can be assigned a new source URI.
 
Method Summary
 java.lang.String emptyResult(IResults res)
          Print an empty result in the SPARQL result format
 java.lang.String getProperty(java.lang.String name)
          Get the value of a corese property if it exists
 void load(java.lang.String path)
          Load RDF (.rdf), RDFS (.rdfs), OWL (.owl) or RULE (.rul) files into Corese
 void loadDir(java.lang.String path)
          Load a whole directory (that can contain RDF (.rdf), RDFS (.rdfs), OWL (.owl) or RULE (.rul) files) into Corese.
 void runRuleEngine()
          Apply rule base on graph base
It should be called only when rules have been previously loaded
 void setProperty(java.lang.String name, java.lang.String value)
          Set the value of a corese property
Examples:
setProperty(ENGINE_DATA, "annot/data annot/data2 annot/testrdf.rdf")
setProperty(ENGINE_DEBUG, "false")
For more informations about corese properties, see http://www-sop.inria.fr/acacia/soft/corese/manual/#coreseproperties
 IResults SPARQLQuery(java.lang.String query)
          Query Corese in the SPARQL syntax
 IResults SPARQLQuery(java.lang.String query, IModel model)
          Query Corese in the SPARQL syntax with a model
 boolean SPARQLValidate(java.lang.String query)
          Validate the query.
 

Field Detail

ENGINE_GUI_NAMESPACE

static final java.lang.String ENGINE_GUI_NAMESPACE
Predefined prefix associated with a namespace
Example: "a http://www.inria.fr/acacia# i http://www.inria.fr#"

See Also:
Constant Field Values

ENGINE_DEBUG

static final java.lang.String ENGINE_DEBUG
If true, prints a maximum of information about the inferences it is making
Values: true or false

See Also:
Constant Field Values

ENGINE_SOURCE_REGEX

static final java.lang.String ENGINE_SOURCE_REGEX
If a URL of a document that contains a graph matches a given pattern, this graph can be assigned a new source URI.
In the following example, every graph whith a name that contained "data.Annotation_Added_The" will be given the URI "http://corese/data/Annotations.rdf/".
Example:
engine.setProperty(ENGINE_SOURCE_REGEX, ".*data.Annotation_Added_The.* http://corese/data/Annotations.rdf/");
Note: see the Java definition of Pattern

See Also:
Constant Field Values

ENGINE_RESULT_MAX

static final java.lang.String ENGINE_RESULT_MAX
Maximum number of result returned after possibly grouping projections
Values: Integer

See Also:
Constant Field Values

ENGINE_PROJECTION_MAX

static final java.lang.String ENGINE_PROJECTION_MAX
Maximum number of projections computed to answer a query
Values: Integer

See Also:
Constant Field Values

ENGINE_SHOW_MAX

static final java.lang.String ENGINE_SHOW_MAX
Maximum number of statements printed by the RDF pretty printer
Values: Integer

See Also:
Constant Field Values

ENGINE_RESULT_JOIN

static final java.lang.String ENGINE_RESULT_JOIN
When this property is set to true, Corese groups projections that share the same first concept into one result.
Values: true or false

See Also:
Constant Field Values
Method Detail

load

void load(java.lang.String path)
          throws EngineException
Load RDF (.rdf), RDFS (.rdfs), OWL (.owl) or RULE (.rul) files into Corese

Parameters:
path - where to find the document to load
Throws:
EngineException
EngineException

loadDir

void loadDir(java.lang.String path)
             throws EngineException
Load a whole directory (that can contain RDF (.rdf), RDFS (.rdfs), OWL (.owl) or RULE (.rul) files) into Corese.
Note: files will be loaded in any order, whereas we should load 1) rdfs or owl 2) rul 3) rdf
Note: files that do not end with .rdf, .owl, .rdf or .rul are ignored.
It would be better to have different directories for each kind of file.
Path can be absolute or relative.

Parameters:
path - where to find the document to load
Throws:
EngineException
EngineException

runRuleEngine

void runRuleEngine()
Apply rule base on graph base
It should be called only when rules have been previously loaded


SPARQLQuery

IResults SPARQLQuery(java.lang.String query)
                     throws EngineException
Query Corese in the SPARQL syntax

Parameters:
query - The query string to test
Returns:
the IResults which corresponds to the Result of the query
Throws:
EngineException

SPARQLQuery

IResults SPARQLQuery(java.lang.String query,
                     IModel model)
                     throws EngineException
Query Corese in the SPARQL syntax with a model

Parameters:
query - The query string to test
model - A model to give the answers to get:gui values
Returns:
the IResults which corresponds to the Result of the query
Throws:
EngineException

SPARQLValidate

boolean SPARQLValidate(java.lang.String query)
                       throws EngineException
Validate the query.

Parameters:
query - The query string to test
Returns:
true if the query is well written (no parsing exception, no compilation exception)
Throws:
EngineException

setProperty

void setProperty(java.lang.String name,
                 java.lang.String value)
Set the value of a corese property
Examples:
setProperty(ENGINE_DATA, "annot/data annot/data2 annot/testrdf.rdf")
setProperty(ENGINE_DEBUG, "false")
For more informations about corese properties, see http://www-sop.inria.fr/acacia/soft/corese/manual/#coreseproperties

Parameters:
name - the name of the property we want to set
value - the value (String) that we want for this property in Corese

getProperty

java.lang.String getProperty(java.lang.String name)
Get the value of a corese property if it exists

Parameters:
name - the name of the property we want to get
Returns:
the value of this property in Corese if it exists (otherwise null)

emptyResult

java.lang.String emptyResult(IResults res)
Print an empty result in the SPARQL result format

Parameters:
res - the result of the query
Returns:
an empty result in the SPARQL result format


COPYRIGHT INRIA © 2007 - Company: INRIA - Project: Acacia - ALL RIGHTS RESERVED.