Class QueryProcess#

Inheritance Relationships#

Base Type#

  • public QuerySolver

Class Documentation#

class QueryProcess : public QuerySolver#

Evaluator of SPARQL query by KGRAM.

Query and Update are synchronized by a read/write lock on the graph There may be several query in parallel OR only one update In addition, graph.init() is synchronized because it may modify the graph

Author

Olivier Corby, Edelweiss, INRIA 2010

Public Functions

inline QueryProcess()#
inline void defineDataManager(DataManager dm)#
inline QueryProcess copy()#
inline void setLoader(Loader ld)#
inline Loader getLoader()#
inline boolean isMatch()#
inline Producer add(Graph g)#
inline Mappings update(String squery)#

API for query

inline Mappings query(String squery)#
inline Mappings queryTurtle(String rdf)#
inline Mappings queryTurtle(Graph g)#
inline Mappings queryTrig(Graph g)#
inline Mappings query(Graph g)#
inline Mappings query(String squery, Mapping map, Dataset ds)#

defaut and named specify a Dataset if the query has no from/using (resp.

named), kgram use defaut (resp. named) if it exist for update, defaut is also used in the delete clause (when there is no with in the query) W3C sparql test cases use this function

inline Mappings query(String squery, Dataset ds)#
inline Mappings query(String squery, Context c)#
inline Mappings query(String squery, AccessRight access)#
inline Mappings query(String squery, Mapping map)#
inline Mappings query(String squery, Binding b)#
inline Mappings query(String squery, Context c, Binding b)#
inline Mappings query(String squery, ProcessVisitor vis)#
inline Query compile(String squery, Dataset ds)#
inline Mappings modifier(String str, Mappings map)#
inline Query compile(String squery)#
inline Query compile(String squery, Context c)#
inline ASTQuery ast(String q)#
inline Mappings query(Query q)#

defaut and named specify a Dataset if the query has no from/using (resp.

using named), kgram use this defaut (resp. named) if it exist for update, this using is not used in the delete clause W3C sparql protocol use this function

inline Mappings eval(Query query, Mapping m, Producer p)#

Use case: LDScript function execute query(construct where) or query(insert where) called by Interpreter exist()

inline Mappings eval(Node gNode, Query query, Mapping m, Producer p)#
inline Mappings queryOld(Graph g)#

RDF Graph g considered as a Query Graph Build a SPARQL BGP with g Generate and eval q KGRAM Query.

inline Mappings query(QueryGraph qg)#
inline Mappings queryGraph(String q)#

q is construct {} where {} eval the construct consider the result as a query graph execute the query graph

inline Mappings sparql(String squery, Dataset ds)#

KGRAM + full SPARQL compliance : - type of arguments of functions (e.g.

sparql regex require string) - variable in select with group by - specify the dataset

inline Mappings sparql(String squery, Dataset ds, int entail)#
inline Mappings query(ASTQuery ast)#
inline Mappings query(ASTQuery ast, Binding b)#
inline Mappings query(ASTQuery ast, Dataset ds)#
inline Mappings update(ASTQuery ast)#

equivalent of std query(ast) but for update

inline Mappings sparqlQuery(String squery)#

Secure Query OR Update

inline Mappings sparqlQuery(String squery, Mapping map, Dataset ds)#
inline Mappings sparqlQuery(Query q, Mapping map, Dataset ds)#
inline Mappings sparqlUpdate(String squery)#
inline Mappings sparqlQueryUpdate(String squery)#
inline Mappings log2Mappings(ContextLog log)#
inline Mappings log2Mappings(ContextLog log, boolean blog)#
inline Mappings basicQuery(Node gNode, Query q, Mapping m)#
inline EventManager getEventManager()#
inline GraphManager getUpdateGraphManager()#
Returns:

Proxy to graph for sparql update

inline Graph getGraph(Mappings map)#
inline Graph getGraph()#
inline void beforeLoad(IDatatype dt, boolean b)#
inline void afterLoad(IDatatype dt, boolean b)#
inline Mappings skolem(Mappings map)#

skolemize the blank nodes of the result Mappings

inline void logStart(Query query)#
inline void logFinish(Query query, Mappings m)#
inline void close()#

inline void event(Event name, Event e, Object o)#

Logger xt:method(us:start, us:Event, event, obj) Use case: event logger.

Deprecated:

inline IDatatype method (String name, String type, IDatatype[] param)

method call: name of method, name of type

inline IDatatype funcall(String name, IDatatype... param)#

Execute LDScript function defined as.

inline IDatatype funcall(String name, Binding b, IDatatype... param)#
inline IDatatype funcall(String name, Context c, IDatatype... param)#
inline IDatatype funcall(String name, Context c, Binding b, IDatatype... param)#
inline Eval getCreateEval()#
inline void init(Query q, Mapping m)#

event : take care of query functions create current Eval with a ProcessVisitor

inline void prepare()#

call function us:prepare() {} before lock graph to complete initialization before query processing to be called explicitely by user use case: GUI QueryExec call prepare() use case: xt:entailment()

inline ProcessVisitor getDefaultVisitor()#
inline ProcessVisitor getVisitor()#
inline TemplateVisitor getTemplateVisitor()#
inline ProcessVisitor createProcessVisitor(Eval eval)#
inline ProcessVisitor createProcessVisitor(Eval eval, String name)#
inline Function getFunction (String name, String type, IDatatype[] param)

Search a method.

us:Event us:start(?e, ?o)

inline ASTQuery parse(String path, Level level)#

<uri> use case: FunctionCompiler <uri>

inline Query parseQuery(String path)#

1- Linked Function 2- owl:imports

inline Query parseQuery(String path, Level level)#
inline boolean imports(String path)#
inline boolean imports(String path, boolean pub)#
inline void getLinkedFunction(String label)#
inline Graph defineFederation(String path)#
inline void defineFederation(String name, List<String> list)#
inline void defineFederation(String name, String... list)#
inline Graph getExceptionGraph(Mappings map)#
inline LogManager getLogManager(Mappings map)#

Manager for local and remote endpoint log getLinkList() is a list of link href url of log document recorded in AST Context use case: service http://corese.inria.fr/d2kab/sparql generates a log document on corese server with URL http://corese.inria.fr/log/url.ttl Query Results XML format contains <link href=”http://corese.inria.fr/log/url.ttl”> client receive result and parse link url.

inline JSONObject getMessage(Mappings map)#
inline String getStringMessage(Mappings map)#
inline QueryProcessUpdate getQueryProcessUpdate()#
inline void setQueryProcessUpdate(QueryProcessUpdate queryProcessUpdate)#
inline ProducerImpl getLocalProducer()#
inline void setLocalProducer(ProducerImpl localProducer)#
inline DataManager getDataManager()#
inline boolean hasDataManager()#
inline DataBroker getDataBroker()#
inline DataBrokerConstruct getDataBrokerUpdate()#
inline void setDataBrokerUpdate(DataBrokerConstruct dataBrokerUpdate)#
inline boolean isProcessTransaction()#
inline void setProcessTransaction(boolean processTransaction)#
inline void startQuery()#
inline void endQuery()#
inline void startUpdate()#
inline void endUpdate()#

Public Static Functions

static inline QueryProcess create()#
static inline QueryProcess create(Graph g)#
static inline QueryProcess create(DataManager dm)#

Query processor for external graph Provide DataManager for query and update of external graph DataManager is stored in ProducerImpl DataManager is used when create GraphManager for update There is still a local corese graph for compatibility Use of DataManager is done in core.producer.DataBrokerExtern and core.producer.DataBrokerUpdateExtern SPARQL construct where return a corese graph.

Query processor for external graph Provide DataManager for query and update of external graph DataManager is stored in ProducerImpl DataManager is used when create GraphManager for update There is still a local corese graph for compatibility Use of DataManager is done in core.producer.DataBrokerExtern and core.producer.DataBrokerUpdateExtern SPARQL construct where return a corese graph

static inline QueryProcess create(Graph g, DataManager dm)#
static inline QueryProcess create (Graph g, DataManager[] dmList)
static inline QueryProcess create(Graph g, boolean isMatch)#

isMatch = true: ?x a h:Person return one occurrence for each instance of Person isMatch = false: ?x a h:Person return all occurrences for each instance of Person where the instance has several types which match Person, such as x a h:Man, h:Person default isMatch = false In addition, each Producer perform local Matcher.match() on its own graph for subsumption Hence each graph can have its own ontology and return one occurrence of each resource for ?x rdf:type aClass isMatch = false: (default) Global producer perform Matcher.match()

static inline QueryProcess stdCreate(Graph g, boolean isMatch)#
static inline QueryProcess copy(Producer p, boolean isMatch)#
static inline QueryProcess create(ProducerImpl p)#
static inline QueryProcess create(Producer p)#
static inline QueryProcess createExtern(Producer p)#
static inline QueryProcess create(Producer prod, Interpreter eval, Matcher match)#

To Be Used by implementation other than Graph.

static inline QueryProcess dbCreate(Graph g, boolean isMatch, String factory, String db)#

When there is a graph database to manage the graph.

static inline synchronized Producer getCreateProducer (Graph g, String factory, String db)
static inline QueryProcess create(Graph g, Graph g2)#
static inline Eval createEval(Graph g, String q)#

Create an Eval initialized with a query q that contains function definitions This Eval can be used to call these functions: eval.eval(name, param) Use case: define callback functions.

static inline Eval createEval(Graph g, Query q)#
static inline void setSort(boolean b)#
static inline Interpreter createInterpreter(Producer p, Matcher m)#

Filter and LDScript Interpreter.

static inline void setOverwrite(boolean b)#
static inline void setReentrant(boolean b)#
static inline boolean isReentrant()#
static inline String getVisitorName()#
static inline void setVisitorName(String aSolverVisitorName)#
static inline String getServerVisitorName()#
static inline void setServerVisitorName(String name)#

Public Static Attributes

static boolean DISPLAY_QUERY = false#
static final String SHACL   = "http://ns.inria.fr/sparql-template/function/datashape/main.rq"

Protected Functions

inline QueryProcess(Producer p, Interpreter e, Matcher m)#