fr.inria.corese.kgram.core.Query.isRelax()方法的使用及代码示例

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

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

Query.isRelax介绍

[英]To relax types on other property than rdf:type
[中]要释放rdf以外的其他属性上的类型,请执行以下操作:type

代码示例

代码示例来源:origin: fr.inria.corese/kgram

  1. public boolean isRecordEdge(){
  2. return isRule() || isRelax();
  3. }

代码示例来源:origin: Wimmics/corese

  1. boolean isType(Edge edge, Environment env) {
  2. return graph.isType(edge) || env.getQuery().isRelax(edge);
  3. }

代码示例来源:origin: Wimmics/corese

  1. /**
  2. * Iterator of Entity that performs local Ontology match.match() Enable to
  3. * have a local ontology in case of several graphs with local ontologies In
  4. * addition, with rdfs entailment, ?x a us:Person return one occurrence of
  5. * each value of ?x
  6. */
  7. Iterable<Edge> localMatch(Iterable<Edge> it, Node gNode, Edge edge, Environment env) {
  8. if (isMatch && !env.getQuery().isRelax()) {
  9. MatchIterator mit = new MatchIterator(it, gNode, edge, graph, env, match);
  10. return mit;
  11. } else {
  12. // if query is relax, we want all types to find best match
  13. // hence skip MatchIterator
  14. return it;
  15. }
  16. }

代码示例来源:origin: fr.inria.corese/kgram

  1. boolean needEdge(){
  2. return getGlobalQuery().isRelax() || getGlobalQuery().isRule();
  3. }

代码示例来源:origin: Wimmics/corese

  1. @Override
  2. public boolean match(Edge q, Edge r, Environment env) {
  3. if (graph.getProxy().isType(q)) { //(q.getLabel().equals(RDF.TYPE)){
  4. return matchType(q, r, env);
  5. }
  6. if (env.getQuery() != null && env.getQuery().isRelax(q)) {
  7. return matchType(q, r, env);
  8. }
  9. if (!q.getLabel().equals(Graph.TOPREL)
  10. && !q.getLabel().equals(r.getLabel())) {
  11. return false;
  12. }
  13. int max = q.nbNode();
  14. if (max > r.nbNode()) {
  15. return false;
  16. }
  17. for (int i = 0; i < max; i++) {
  18. Node qNode = q.getNode(i);
  19. Node node = r.getNode(i);
  20. if (!match(qNode, node, env)) {
  21. return false;
  22. }
  23. }
  24. return true;
  25. }

代码示例来源:origin: fr.inria.corese/corese-core

  1. @Override
  2. public boolean match(Edge q, Edge r, Environment env) {
  3. if (graph.getProxy().isType(q)) { //(q.getLabel().equals(RDF.TYPE)){
  4. return matchType(q, r, env);
  5. }
  6. if (env.getQuery() != null && env.getQuery().isRelax(q)) {
  7. return matchType(q, r, env);
  8. }
  9. if (!q.getLabel().equals(Graph.TOPREL)
  10. && !q.getLabel().equals(r.getLabel())) {
  11. return false;
  12. }
  13. int max = q.nbNode();
  14. if (max > r.nbNode()) {
  15. return false;
  16. }
  17. for (int i = 0; i < max; i++) {
  18. Node qNode = q.getNode(i);
  19. Node node = r.getNode(i);
  20. if (!match(qNode, node, env)) {
  21. return false;
  22. }
  23. }
  24. return true;
  25. }

代码示例来源:origin: Wimmics/corese

  1. if ((g.isType(qEdge) || env.getQuery().isRelax(qEdge))
  2. && qEdge.getNode(1).isConstant()) {

代码示例来源:origin: Wimmics/corese

  1. if (query != null && query.isRelax()) {
  2. return true;

代码示例来源:origin: fr.inria.corese/corese-core

  1. if (query != null && query.isRelax()) {
  2. return true;

相关文章