Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import fr.inria.corese.core.next.data.impl.io.serialization.rdfxml.RDFXMLSerializer;
import fr.inria.corese.core.next.data.impl.io.serialization.trig.TriGSerializer;
import fr.inria.corese.core.next.data.impl.io.serialization.turtle.TurtleSerializer;
import fr.inria.corese.core.next.data.impl.temp.CoreseAdaptedValueFactory;
import fr.inria.corese.core.next.data.impl.temp.CoreseValueFactory;

import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -55,7 +55,7 @@ public class DataSerializerFactory implements SerializerFactory {
* it falls back to the format's default configuration.
*/
public DataSerializerFactory() {
this.coreseValueFactory = new CoreseAdaptedValueFactory();
this.coreseValueFactory = new CoreseValueFactory();

Map<RDFFormat, BiFunction<Model, IOOptions, RDFSerializer>> tempRegistry = new HashMap<>();
Map<RDFFormat, Function<Model, RDFSerializer>> tempDefaultRegistry = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class CoreseValueConverter {

// Factory for creating Corese-compatible Value instances
private final ValueFactory factory = new CoreseAdaptedValueFactory();
private final ValueFactory factory = new CoreseValueFactory();

// Constant representing the default Corese graph context
private static final Node DEFAULT_CORESE_CONTEXT = DatatypeMap.createResource(ExpType.DEFAULT_GRAPH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@
/**
* Factory for all the Corese adapted values.
*/
public class CoreseAdaptedValueFactory implements ValueFactory {
public class CoreseValueFactory implements ValueFactory {

private static final SecureRandom secureRandom = new SecureRandom();

private final AtomicLong nodeID = new AtomicLong(secureRandom.nextLong());

public CoreseAdaptedValueFactory() {
public CoreseValueFactory() {
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* @author Olivier Corby, Wimmics, INRIA 2019
*/
public interface DatatypeValueFactory {
public interface DatatypeNodeFactory {

Node nodeList(List<Node> list);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/**
* @author corby
*/
public interface DQPFactory {
public interface DistributedQueryPlanFactory {

BgpGenerator instance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import fr.inria.corese.core.next.query.kgram.api.core.Expr;
import fr.inria.corese.core.next.query.kgram.api.core.Node;
import fr.inria.corese.core.next.query.kgram.core.*;
import fr.inria.corese.core.next.query.kgram.event.EventManager;
import fr.inria.corese.core.next.query.kgram.event.KgramEventDispatcher;
import fr.inria.corese.core.next.query.kgram.path.Path;
import fr.inria.corese.core.next.query.kgram.tool.ApproximateSearchEnv;
import fr.inria.corese.core.sparql.api.IDatatype;
Expand Down Expand Up @@ -95,7 +95,7 @@ default void setGraphNode(Node n) {

int count();

EventManager getEventManager();
KgramEventDispatcher getEventManager();

Object getObject();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Iterable<Edge> getEdges(Node gNode, List<Node> from, Edge qEdge, Environment env
boolean isBindable(Node node);


DatatypeValueFactory getDatatypeValueFactory();
DatatypeNodeFactory getDatatypeNodeFactory();

/**
* Given an object resulting from the evaluation of an extension function,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import fr.inria.corese.core.next.query.kgram.api.query.*;
import fr.inria.corese.core.next.query.kgram.event.Event;
import fr.inria.corese.core.next.query.kgram.event.EventImpl;
import fr.inria.corese.core.next.query.kgram.event.EventManager;
import fr.inria.corese.core.next.query.kgram.event.KgramEventDispatcher;
import fr.inria.corese.core.next.query.kgram.event.ResultListener;
import fr.inria.corese.core.next.query.kgram.path.PathFinder;
import fr.inria.corese.core.sparql.api.IDatatype;
Expand Down Expand Up @@ -52,7 +52,7 @@ public class Eval implements ExpType, Plugin {
setNewMappingsVersion(true);
}

EventManager manager;
KgramEventDispatcher manager;
boolean hasEvent = false;
// Edge and Node producer
Producer saveProducer;
Expand Down Expand Up @@ -1798,7 +1798,7 @@ private boolean match(Mapping map) {

public void createManager() {
if (manager == null) {
setEventManager(new EventManager());
setEventManager(new KgramEventDispatcher());
if (memory != null) {
memory.setEventManager(manager);
}
Expand All @@ -1808,11 +1808,11 @@ public void createManager() {
}
}

public EventManager getEventManager() {
public KgramEventDispatcher getEventManager() {
return manager;
}

public void setEventManager(EventManager man) {
public void setEventManager(KgramEventDispatcher man) {
manager = man;
hasEvent = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ public boolean bound(List<String> fvec, List<String> evec) {
* inSubScope = true : collect nodes of left of optional and surely bound by union
* optional = true : we are inside an optional
*/
void getNodes(ExpHandler h) {
void getNodes(ExpNodeCollector h) {
switch (type()) {
case FILTER:
// get exists {} nodes
Expand Down Expand Up @@ -1125,7 +1125,7 @@ boolean isSkipStatement() {
/**
* complete handler selectList with this query selectList
*/
void queryNodeList(ExpHandler h) {
void queryNodeList(ExpNodeCollector h) {
List<Node> selectList = h.getSelectNodeList();
List<Node> subSelectList = getQuery().getSelect();

Expand Down Expand Up @@ -1156,7 +1156,7 @@ public Exp getPattern(Expr exp) {
/**
* This is a filter get exists{} nodes if any
*/
void getExistNodes(Expr exp, ExpHandler h, List<Node> lExistNode) {
void getExistNodes(Expr exp, ExpNodeCollector h, List<Node> lExistNode) {
if (exp.oper() == ExprType.EXIST) {
Exp pat = getPattern(exp);
List<Node> lNode = pat.getTheNodes(h.copy());
Expand Down Expand Up @@ -1211,13 +1211,13 @@ List<Node> getInScopeNodes(boolean bind) {
return getTheNodes(handler(true, bind).sample());
}

public List<Node> getTheNodes(ExpHandler h) {
public List<Node> getTheNodes(ExpNodeCollector h) {
getNodes(h);
return h.getNodes();
}

ExpHandler handler(boolean inSubScope, boolean bind) {
return new ExpHandler(inSubScope, bind);
ExpNodeCollector handler(boolean inSubScope, boolean bind) {
return new ExpNodeCollector(inSubScope, bind);
}

void add(List<Node> lNode, Node node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
*
*/
public class ExpHandler {
public class ExpNodeCollector {

private List<Node> nodeList;
private final List<Node> selectNodeList;
Expand All @@ -22,19 +22,19 @@ public class ExpHandler {
// when false, return nodes from first exp
private boolean all = true;

public ExpHandler() {
public ExpNodeCollector() {
nodeList = new ArrayList<>();
selectNodeList = new ArrayList<>();
existNodeList = new ArrayList<>();
}

public ExpHandler(boolean inSubScope, boolean bind) {
public ExpNodeCollector(boolean inSubScope, boolean bind) {
this();
setInSubScope(inSubScope).setBind(bind);
}

public ExpHandler copy() {
ExpHandler h = new ExpHandler();
public ExpNodeCollector copy() {
ExpNodeCollector h = new ExpNodeCollector();
h.setAll(isAll()).setBind(isBind())
.setBlank(isBlank()).setExist(isExist())
.setInSubScope(isInSubScope());
Expand Down Expand Up @@ -116,7 +116,7 @@ public boolean isInSubScope() {
return inSubScope;
}

public ExpHandler setInSubScope(boolean inSubScope) {
public ExpNodeCollector setInSubScope(boolean inSubScope) {
this.inSubScope = inSubScope;
return this;
}
Expand All @@ -129,7 +129,7 @@ public boolean isBind() {
return bind;
}

public ExpHandler setBind(boolean bind) {
public ExpNodeCollector setBind(boolean bind) {
this.bind = bind;
return this;
}
Expand All @@ -138,7 +138,7 @@ public boolean isBlank() {
return blank;
}

public ExpHandler setBlank(boolean blank) {
public ExpNodeCollector setBlank(boolean blank) {
this.blank = blank;
return this;
}
Expand All @@ -147,7 +147,7 @@ public boolean isOptional() {
return optional;
}

public ExpHandler setOptional(boolean optional) {
public ExpNodeCollector setOptional(boolean optional) {
this.optional = optional;
return this;
}
Expand All @@ -156,7 +156,7 @@ public boolean isExist() {
return exist;
}

public ExpHandler setExist(boolean exist) {
public ExpNodeCollector setExist(boolean exist) {
this.exist = exist;
return this;
}
Expand All @@ -165,20 +165,20 @@ public boolean isAll() {
return all;
}

public ExpHandler setAll(boolean all) {
public ExpNodeCollector setAll(boolean all) {
this.all = all;
return this;
}

// return nodes from first exp of BGP
// use case: compute relevant variable bindings
public ExpHandler sample() {
public ExpNodeCollector sample() {
setAll(false);
return this;
}

// return all nodes
public ExpHandler all() {
public ExpNodeCollector all() {
setAll(true);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import fr.inria.corese.core.next.query.kgram.api.query.Producer;
import fr.inria.corese.core.next.query.kgram.event.Event;
import fr.inria.corese.core.next.query.kgram.event.EventImpl;
import fr.inria.corese.core.next.query.kgram.event.EventManager;
import fr.inria.corese.core.next.query.kgram.event.KgramEventDispatcher;
import fr.inria.corese.core.sparql.api.IDatatype;

import java.util.*;
Expand Down Expand Up @@ -39,7 +39,7 @@ public class Mappings extends PointerObject
boolean isListGroup = false;
boolean sortWithDesc = true;
List<Mapping> reject;
EventManager manager;
KgramEventDispatcher manager;
int count = 0;
private Query query;
private final List<Mapping> list;
Expand Down Expand Up @@ -101,7 +101,7 @@ public static Mappings create(Query q, boolean subEval) {
}


void setEventManager(EventManager man) {
void setEventManager(KgramEventDispatcher man) {
manager = man;
hasEvent = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import fr.inria.corese.core.next.query.kgram.adapter.BindingAdapter;
import fr.inria.corese.core.next.query.kgram.api.core.*;
import fr.inria.corese.core.next.query.kgram.api.query.*;
import fr.inria.corese.core.next.query.kgram.event.EventManager;
import fr.inria.corese.core.next.query.kgram.event.KgramEventDispatcher;
import fr.inria.corese.core.next.query.kgram.path.Path;
import fr.inria.corese.core.next.query.kgram.tool.ApproximateSearchEnv;
import fr.inria.corese.core.sparql.api.IDatatype;
Expand Down Expand Up @@ -53,7 +53,7 @@ public class Memory extends PointerObject implements Environment {
Mapping mapping;
// true when processing aggregate at the end
boolean isAggregate = false;
EventManager manager;
KgramEventDispatcher manager;
boolean hasEvent = false;
int nbEdge = 0;
int nbNode = 0;
Expand All @@ -75,14 +75,14 @@ public Memory(Matcher m, Evaluator e) {
}

@Override
public EventManager getEventManager() {
public KgramEventDispatcher getEventManager() {
if (manager == null) {
kgram.createManager();
}
return manager;
}

void setEventManager(EventManager man) {
void setEventManager(KgramEventDispatcher man) {
manager = man;
hasEvent = true;
}
Expand Down Expand Up @@ -559,13 +559,13 @@ boolean pushList(Producer p, Node node, Edge edge, int i) {
for (int j = i; j < edge.nbNode(); j++) {
list.add(edge.getNode(j));
}
Node target = (p == null) ? node : p.getDatatypeValueFactory().nodeList(list);
Node target = (p == null) ? node : p.getDatatypeNodeFactory().nodeList(list);
return push(node, target, i);
}

boolean pushCardinality(Producer p, Node node, Edge edge, int i) {
int n = edge.nbNode() - i;
Node target = (p == null) ? node : p.getDatatypeValueFactory().nodeValue(n);
Node target = (p == null) ? node : p.getDatatypeNodeFactory().nodeValue(n);
return push(node, target, i);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import fr.inria.corese.core.next.query.kgram.api.core.*;
import fr.inria.corese.core.next.query.kgram.api.core.Filter;
import fr.inria.corese.core.next.query.kgram.api.query.DQPFactory;
import fr.inria.corese.core.next.query.kgram.api.query.DistributedQueryPlanFactory;
import fr.inria.corese.core.next.query.kgram.api.query.Matcher;
import fr.inria.corese.core.next.query.kgram.api.query.Producer;
import fr.inria.corese.core.next.query.kgram.filter.Compile;
Expand Down Expand Up @@ -44,12 +44,12 @@ public class Query extends Exp {
public static boolean testJoin = false;
public static boolean isOptional = true;

private static DQPFactory factory;
private static DistributedQueryPlanFactory factory;

/**
* @return the factory
*/
public static DQPFactory getFactory() {
public static DistributedQueryPlanFactory getFactory() {
return factory;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import java.util.Map;
import java.util.Map.Entry;

import static fr.inria.corese.core.next.query.kgram.sorter.core.Const.plannable;
import static fr.inria.corese.core.next.query.kgram.sorter.core.QuerySorterConst.plannable;

/**
* A new sorter for QP
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author Olivier Corby, Edelweiss, INRIA 2010
*
*/
public class EventManager implements Iterable<EventListener> {
public class KgramEventDispatcher implements Iterable<EventListener> {

boolean isEval = false;

Expand Down
Loading
Loading