本文整理汇总了Java中com.hp.hpl.jena.sparql.syntax.ElementFilter类的典型用法代码示例。如果您正苦于以下问题:Java ElementFilter类的具体用法?Java ElementFilter怎么用?Java ElementFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ElementFilter类属于com.hp.hpl.jena.sparql.syntax包,在下文中一共展示了ElementFilter类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: evaluate
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
TestingSelector testingSelector = (TestingSelector) nodeSelector;
FunctionTest functionTest = (FunctionTest) testingSelector.getTest();
if(functionTest.getArgSelectors().get(0) instanceof PropertySelector) {
PropertySelector arg = (PropertySelector) functionTest.getArgSelectors().get(0);
PropertySelector delegate = (PropertySelector) testingSelector.getDelegate();
Var target = Var.alloc(VarIDGenerator.createID());
elementGroup.addTriplePattern(new Triple(var.asNode(), NodeFactory.createURI(delegate.getProperty().toString()), target));
Var selector = Var.alloc(VarIDGenerator.createID());
elementGroup.addTriplePattern(new Triple(target.asNode(), NodeFactory.createURI(arg.getProperty().toString()), selector.asNode()));
elementGroup.addElementFilter(new ElementFilter(new E_IsLiteral(new ExprVar(selector))));
return selector;
} else {
throw new IllegalStateException("Argument of function isLiteral has to be a PropertySelector");
}
}
开发者ID:anno4j,项目名称:anno4j,代码行数:23,代码来源:IsLiteralTestEvaluator.java
示例2: registerSerializers
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
/**
* @param conf
* register some Jena serialisers to this configuration
*/
public static void registerSerializers(Config conf) {
conf.registerSerialization(Node[].class, NodeSerialiser_ARRAY.class);
conf.registerSerialization(Node_URI.class, NodeSerialiser_URI.class);
conf.registerSerialization(Node_Literal.class, NodeSerialiser_Literal.class);
conf.registerSerialization(Node_Blank.class, NodeSerialiser_Blank.class);
conf.registerSerialization(Node_Variable.class, NodeSerialiser_Variable.class);
conf.registerSerialization(Triple.class, TripleSerialiser.class);
conf.registerSerialization(ArrayList.class);
conf.registerSerialization(KestrelServerSpec.class, KestrelServerSpec_Serializer.class);
conf.registerSerialization(Rule.class, RuleSerializer.class);
conf.registerSerialization(Graph.class, GraphSerialiser.class);
conf.registerSerialization(GraphMem.class, GraphSerialiser.class);
conf.registerSerialization(MultiUnion.class, GraphSerialiser.class);
conf.registerSerialization(Template.class, TemplateSerialiser.class);
conf.registerSerialization(ElementFilter.class);
// conf.registerSerialization(Node_NULL.class);
// conf.registerSerialization(Node_Blank.class);
}
开发者ID:openimaj,项目名称:openimaj,代码行数:23,代码来源:JenaStormUtils.java
示例3: createBody
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
protected Element createBody() {
ElementUnion labels = SparqlElementFactory.createConceptLabelUnion(
CONCEPT.createVar(),
LABEL.createVar());
Triple scheme = createSchemeTriple(CONCEPT, IN_SCHEME);
ElementGroup labelsAndScheme = createGroup().add(labels).add(scheme).build();
ElementUnion exactMatches = SparqlElementFactory.createExactMatchUnion(
CONCEPT.createVar(),
createVariable(QUERIED_CONCEPT));
Triple source = SparqlElementFactory.createSourceTriple(IN_SCHEME, sourceLabel);
ElementFilter filter = createFilter(LABEL, IN_SCHEME);
return createGroup()
.add(labelsAndScheme)
.add(exactMatches)
.addOptional(source, sourceActive)
.add(filter)
.build();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:20,代码来源:SynonymsCrossWalkingQueryBuilder.java
示例4: evaluate
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
TestingSelector testingSelector = (TestingSelector) nodeSelector;
NodeTest nodeTest = testingSelector.getTest();
Var delVar = LDPathEvaluator.evaluate(testingSelector.getDelegate(), elementGroup, var, evaluatorConfiguration);
elementGroup.addElementFilter(new ElementFilter(evaluate(nodeTest, elementGroup, delVar, evaluatorConfiguration)));
return var;
}
开发者ID:anno4j,项目名称:anno4j,代码行数:10,代码来源:PathEqualityTestEvaluator.java
示例5: evaluate
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
TestingSelector testingSelector = (TestingSelector) nodeSelector;
NodeTest nodeTest = testingSelector.getTest();
Var delVar = LDPathEvaluator.evaluate(testingSelector.getDelegate(), elementGroup, var, evaluatorConfiguration);
elementGroup.addElementFilter(new ElementFilter(evaluate(nodeTest, elementGroup, delVar, evaluatorConfiguration)));
return delVar;
}
开发者ID:anno4j,项目名称:anno4j,代码行数:10,代码来源:LiteralTypeTestEvaluator.java
示例6: evaluate
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
TestingSelector testingSelector = (TestingSelector) nodeSelector;
Var delVar = LDPathEvaluator.evaluate(testingSelector.getDelegate(), elementGroup, var, evaluatorConfiguration);
elementGroup.addElementFilter(new ElementFilter(evaluate(testingSelector.getTest(), elementGroup, delVar, evaluatorConfiguration)));
return delVar;
}
开发者ID:anno4j,项目名称:anno4j,代码行数:8,代码来源:NotTestEvaluator.java
示例7: evaluate
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
public Var evaluate(NodeSelector nodeSelector, ElementGroup elementGroup, Var var, LDPathEvaluatorConfiguration evaluatorConfiguration) {
TestingSelector testingSelector = (TestingSelector) nodeSelector;
Var delVar = LDPathEvaluator.evaluate(testingSelector.getDelegate(), elementGroup, var, evaluatorConfiguration);
elementGroup.addElementFilter(new ElementFilter(evaluate(testingSelector.getTest(), elementGroup, delVar, evaluatorConfiguration)));
return var;
}
开发者ID:anno4j,项目名称:anno4j,代码行数:8,代码来源:AndTestEvaluator.java
示例8: createFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
private ElementFilter createFilter() {
return use(NodeValue.TRUE)
//
.and(
createMultipleOptionsExpression(
new SparqlLanguageExpression(topMostConceptLabel),
getLanguages()),
!getLanguages().isEmpty())
.and(
createMultipleOptionsExpression(new SparqlUriExpression(IN_SCHEME), getSchemas()),
!getSchemas().isEmpty())
.toElementFilter();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:14,代码来源:TopMostConceptSparqlQueryBuilder.java
示例9: createFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
private ElementFilter createFilter(SparqlNodes label, SparqlNodes scheme) {
return use(TRUE)
.and(
createMultipleOptionsExpression(new SparqlLanguageExpression(label), getLanguages()),
!getLanguages().isEmpty())
.and(
createMultipleOptionsExpression(new SparqlUriExpression(scheme), getSchemas()),
!getSchemas().isEmpty())
.toElementFilter();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:11,代码来源:RelativesCrossWalkingQueryBuilder.java
示例10: createFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
private ElementFilter createFilter(SparqlNodes label, SparqlNodes scheme, SparqlNodes relation) {
List<String> relationUris = SparqlNodes.getRelationUris();
return use(new SparqlUriExpression(QUERIED_CONCEPT).create(concept))
.and(
createMultipleOptionsExpression(new SparqlLanguageExpression(label), getLanguages()),
!getLanguages().isEmpty())
.and(
createMultipleOptionsExpression(new SparqlUriExpression(scheme), getSchemas()),
!getSchemas().isEmpty())
.and(createMultipleOptionsExpression(new SparqlUriExpression(relation), relationUris))
.toElementFilter();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:13,代码来源:RelativesQueryBuilder.java
示例11: createBody
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
protected Element createBody() {
Element labels = SparqlElementFactory.createConceptLabelUnion(
CONCEPT.createVar(),
LABEL.createVar());
Triple schema = SparqlElementFactory.createSchemeTriple(CONCEPT, IN_SCHEME);
Triple source = SparqlElementFactory.createSourceTriple(IN_SCHEME, sourceLabel);
Triple matches = Triple.create(
CONCEPT.createVariableNode(),
EXACT_MATCH.createUriNode(),
EXACT_MATCH.createVariableNode());
Triple rank = Triple.create(
IN_SCHEME.createVariableNode(),
SORT_PRIORITY.createUriNode(),
SORT_PRIORITY.createVariableNode());
ElementFilter filter = createFilter();
return ElementGroupBuilder
.createGroup()
.add(labels)
.add(schema)
.add(rank)
.addOptional(matches)
.addOptional(source, sourceActive)
.add(filter)
.build();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:28,代码来源:SuggestionCrossWalkingSparqlQueryBuilder.java
示例12: createFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
private ElementFilter createFilter() {
return use(new SparqlLowerCaseExpression(LABEL.createExprVar()).create(keyword))
.and(
createMultipleOptionsExpression(new SparqlLanguageExpression(LABEL), getLanguages()),
!getLanguages().isEmpty())
.and(
createMultipleOptionsExpression(new SparqlUriExpression(IN_SCHEME), getSchemas()),
!getSchemas().isEmpty())
.toElementFilter();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:11,代码来源:SuggestionCrossWalkingSparqlQueryBuilder.java
示例13: createBody
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
@Override
protected Element createBody() {
ElementUnion labels = SparqlElementFactory.createConceptLabelUnion(
CONCEPT.createVar(),
LABEL.createVar());
Triple scheme = SparqlElementFactory.createSchemeTriple(CONCEPT, IN_SCHEME);
Triple source = SparqlElementFactory.createSourceTriple(IN_SCHEME, sourceLabel);
ElementFilter filter = createFilter(LABEL, IN_SCHEME);
return createGroup()
.add(labels)
.add(scheme)
.addOptional(source, sourceActive)
.add(filter)
.build();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:16,代码来源:SynonymsQueryBuilder.java
示例14: createFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
private ElementFilter createFilter(SparqlNodes label, SparqlNodes scheme) {
return use(new SparqlUriExpression(CONCEPT).create(concept))
.and(
createMultipleOptionsExpression(new SparqlLanguageExpression(label), getLanguages()),
!getLanguages().isEmpty())
.and(
createMultipleOptionsExpression(new SparqlUriExpression(scheme), getSchemas()),
!getSchemas().isEmpty())
.toElementFilter();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:11,代码来源:SynonymsQueryBuilder.java
示例15: createFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
private ElementFilter createFilter(SparqlNodes label, SparqlNodes scheme) {
return use(new SparqlUriExpression(new ExprVar(QUERIED_CONCEPT)).create(concept))//
.and(
createMultipleOptionsExpression(new SparqlLanguageExpression(label), getLanguages()),
!getLanguages().isEmpty())
.and(
createMultipleOptionsExpression(new SparqlUriExpression(scheme), getSchemas()),
!getSchemas().isEmpty())
.toElementFilter();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:11,代码来源:SynonymsCrossWalkingQueryBuilder.java
示例16: createFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
private ElementFilter createFilter() {
return use(TRUE)
.and(createNoLiteralOrLanguageExpression(), !getLanguages().isEmpty())
.and(
createMultipleOptionsExpression(new SparqlUriExpression(IN_SCHEME), getSchemas()),
!getSchemas().isEmpty())
.toElementFilter();
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:9,代码来源:SimpleExplanationQueryBuilder.java
示例17: Filter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
final public Element Filter() throws ParseException {
Expr c ;
jj_consume_token(FILTER);
c = Constraint();
{if (true) return new ElementFilter(c) ;}
throw new Error("Missing return statement in function");
}
开发者ID:KMax,项目名称:cqels,代码行数:8,代码来源:CQELSParser.java
示例18: evaluate
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
public static void evaluate(ElementGroup elementGroup, Criteria criteria, Var variable, String resolvedConstraint) {
if (criteria.isNaN()) {
String constraint = "";
// Setting the boundaries (\b) to the RegExp, according to the comparison type
if (Comparison.EQ.equals(criteria.getComparison())) {
constraint = "^" + resolvedConstraint + "$";
} else if (Comparison.CONTAINS.equals(criteria.getComparison())) {
constraint = resolvedConstraint;
} else if (Comparison.STARTS_WITH.equals(criteria.getComparison())) {
constraint = "^" + resolvedConstraint;
} else if (Comparison.ENDS_WITH.equals(criteria.getComparison())) {
constraint = resolvedConstraint + "$";
} else {
throw new IllegalStateException(criteria.getComparison() + " is only allowed on Numbers.");
}
if (!constraint.equals("")) {
elementGroup.addElementFilter(new ElementFilter(new E_Regex(new E_Str(new ExprVar(variable.asNode())), constraint , "")));
}
} else {
Expr expr;
if (criteria.getComparison().equals(Comparison.GT)) {
expr = new E_GreaterThan(new ExprVar(variable.asNode()), new NodeValueDouble(Double.parseDouble(resolvedConstraint)));
} else if (criteria.getComparison().equals(Comparison.GTE)) {
expr = new E_GreaterThanOrEqual(new ExprVar(variable.asNode()), new NodeValueDouble(Double.parseDouble(resolvedConstraint)));
} else if (criteria.getComparison().equals(Comparison.LT)) {
expr = new E_LessThan(new ExprVar(variable.asNode()), new NodeValueDouble(Double.parseDouble(resolvedConstraint)));
} else if (criteria.getComparison().equals(Comparison.LTE)) {
expr = new E_LessThanOrEqual(new ExprVar(variable.asNode()), new NodeValueDouble(Double.parseDouble(resolvedConstraint)));
} else if (criteria.getComparison().equals(Comparison.EQ)) {
expr = new E_Equals(new ExprVar(variable.asNode()), new ExprVar(criteria.getConstraint()));
} else {
throw new IllegalStateException(criteria.getComparison() + " is not allowed on Numbers.");
}
if(expr != null) {
elementGroup.addElementFilter(new ElementFilter(expr));
}
}
}
开发者ID:anno4j,项目名称:anno4j,代码行数:45,代码来源:EvalComparison.java
示例19: addAsFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
public ElementGroupBuilder addAsFilter(Expr expression) {
group.addElementFilter(new ElementFilter(expression));
return this;
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:5,代码来源:ElementGroupBuilder.java
示例20: toElementFilter
import com.hp.hpl.jena.sparql.syntax.ElementFilter; //导入依赖的package包/类
public ElementFilter toElementFilter() {
return new ElementFilter(current);
}
开发者ID:eENVplus,项目名称:tf-exploitation-server,代码行数:4,代码来源:SparqlExpressionBuilder.java
注:本文中的com.hp.hpl.jena.sparql.syntax.ElementFilter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论