org.apache.jena.query.Query.setQueryConstructType()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(159)

本文整理了Java中org.apache.jena.query.Query.setQueryConstructType方法的一些代码示例,展示了Query.setQueryConstructType的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setQueryConstructType方法的具体详情如下:
包路径:org.apache.jena.query.Query
类名称:Query
方法名:setQueryConstructType

Query.setQueryConstructType介绍

暂无

代码示例

代码示例来源:origin: apache/jena

/**
 * Constructor
 */
public ConstructBuilder() {
  super();
  query.setQueryConstructType();
  handlerBlock = new HandlerBlock(query);
}

代码示例来源:origin: org.apache.jena/jena-querybuilder

/**
 * Constructor
 */
public ConstructBuilder() {
  super();
  query.setQueryConstructType();
  handlerBlock = new HandlerBlock(query);
}

代码示例来源:origin: apache/jena

@Override
public void visitConstructResultForm(Query query) {
  newQuery.setQueryConstructType();
  newQuery.setConstructTemplate(query.getConstructTemplate());
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

@Override
public void visitConstructResultForm(Query query) {
  newQuery.setQueryConstructType() ;
  newQuery.setConstructTemplate(query.getConstructTemplate()) ;
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

/**
 * Deprecated, because with the construct approach we cannot get a tripe's context resource
 *
 * @param concepts
 * @param filter
 * @return
 */
@Deprecated
public static Query createQueryConstruct(List<Concept> concepts, Concept filter) {
  Template template = new Template(BasicPattern.wrap(Collections.singletonList(Triples.spo)));
  List<Concept> tmps = new ArrayList<Concept>();
  for(Concept concept : concepts) {
    Concept tmp = ConceptOps.intersect(concept, filter, null);
    tmps.add(tmp);
  }
  List<Element> elements = new ArrayList<Element>();
  for(Concept concept : tmps) {
    Element e = concept.getElement();
    elements.add(e);
  }
  Element element = ElementUtils.union(elements);
  Query result = new Query();
  result.setQueryConstructType();
  result.setConstructTemplate(template);
  result.setQueryPattern(element);
  return result;
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static Query constructBySubjects(Collection<Node> ss) {
  ExprVar vs = new ExprVar(s);
  Query query = QueryFactory.create();
  query.setQueryConstructType();
  query.setDistinct(true);
  Triple triple = new Triple(s, p, o);
  ElementGroup group = new ElementGroup();
  group.addTriplePattern(triple);
  List<Expr> exprs = new ArrayList<Expr>();
  for(Node item : ss) {
    if(!item.isURI()) {
      continue;
    }
    exprs.add(new E_Equals(vs, NodeValue.makeNode(item)));
  }
  if(exprs.isEmpty()) {
    return null;
  }
  Expr or = ExprUtils.orifyBalanced(exprs);
  group.addElementFilter(new ElementFilter(or));
  BasicPattern bgp = new BasicPattern();
  bgp.add(triple);
  query.setConstructTemplate(new Template(bgp));
  query.setQueryPattern(group);
  return query;
}

代码示例来源:origin: apache/jena

final public void ConstructQuery() throws ParseException {
            Template t ;
 jj_consume_token(CONSTRUCT);
  getQuery().setQueryConstructType() ;
 t = ConstructTemplate();
  getQuery().setConstructTemplate(t) ;
 label_4:
 while (true) {
  switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  case FROM:
   ;
   break;
  default:
   jj_la1[8] = jj_gen;
   break label_4;
  }
  DatasetClause();
 }
 WhereClause();
 SolutionModifier();
}

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static Query constructBySubject(Node s) {
  Triple triple = new Triple(s, p, o);
  BasicPattern basicPattern = new BasicPattern();
  basicPattern.add(triple);
  Template template = new Template(basicPattern);
  ElementGroup elementGroup = new ElementGroup();
  ElementPathBlock pathBlock = new ElementPathBlock();
  elementGroup.addElement(pathBlock);
  pathBlock.addTriple(triple);
  Query query = new Query();
  query.setQueryConstructType();
  query.setConstructTemplate(template);
  query.setQueryPattern(elementGroup);
  return query;
}

代码示例来源:origin: apache/jena

break;
case Query.QueryTypeConstruct:
  q.setQueryConstructType();
  break;
case Query.QueryTypeDescribe:

代码示例来源:origin: apache/jena

} else if (q2.isConstructType()) 
  retval.setQueryConstructType();

代码示例来源:origin: org.apache.jena/jena-querybuilder

break;
case Query.QueryTypeConstruct:
  q.setQueryConstructType();
  break;
case Query.QueryTypeDescribe:

代码示例来源:origin: org.apache.jena/jena-querybuilder

} else if (q2.isConstructType()) 
  retval.setQueryConstructType();

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static Query createQueryTriple(Triple m) {
  Query query = new Query();
  query.setQueryConstructType();
  /*
  Node s = m.getMatchSubject();
  Node p = m.getMatchPredicate();
  Node o = m.getMatchObject();
  */
  Node s = m.getSubject();
  Node p = m.getPredicate();
  Node o = m.getObject();
  s = s == null || s.equals(Node.ANY) ? Vars.s : s;
  p = p == null || p.equals(Node.ANY) ? Vars.p : p;
  o = o == null || o.equals(Node.ANY) ? Vars.o : o;
  Triple triple = new Triple(s, p, o);
  BasicPattern bgp = new BasicPattern();
  bgp.add(triple);
  Template template = new Template(bgp);
  Element element = new ElementTriplesBlock(bgp);
  query.setConstructTemplate(template);
  query.setQueryPattern(element);
  return query;
}

代码示例来源:origin: com.github.galigator.openllet/openllet-jena

q.setQueryConstructType();

代码示例来源:origin: Galigator/openllet

q.setQueryConstructType();

代码示例来源:origin: SmartDataAnalytics/jena-sparql-api

public static Query inOutTemplate(Node s, Node p, Node o)
{
  Query query = QueryFactory.create();
  query.setQueryConstructType();
  query.setDistinct(true);
  Triple triple = new Triple(s, p, o);
  ElementGroup group = new ElementGroup();
  group.addTriplePattern(triple);
  // Avoid non-uris as objects
  if(o.isVariable()) {
    group.addElementFilter(new ElementFilter(new E_IsURI(new ExprVar(o))));
    group.addElementFilter(new ElementFilter(new E_LogicalNot(new E_IsBlank(new ExprVar(o)))));
  }
  BasicPattern bgp = new BasicPattern();
  bgp.add(triple);
  query.setConstructTemplate(new Template(bgp));
  query.setQueryPattern(group);
  return query;
}

代码示例来源:origin: apache/jena

QuadAcc acc = new QuadAcc() ;
jj_consume_token(CONSTRUCT);
 getQuery().setQueryConstructType() ;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACE:

代码示例来源:origin: apache/jena

TripleCollectorBGP acc = new TripleCollectorBGP() ;
jj_consume_token(CONSTRUCT);
 getQuery().setQueryConstructType() ;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACE:

相关文章