Package org.wikier.trioo.jtrioo.rdf.sparql

Examples of org.wikier.trioo.jtrioo.rdf.sparql.TriplePattern


    }

  }
 
  public void visit(CURIE rdftype) {
    this.query.addTriplePattern(new TriplePattern(this.x, new AbbrevRdfType(), rdftype));
  }
View Full Code Here


 
  public void visit(Arc arc) {
    //FIXME: single/multi literal/object
    if (arc.pointsLiteral()) {
      Variable var = new Variable(arc.getTarget());
      TriplePattern pattern = new TriplePattern(this.x, arc.getProperty(), var);
      pattern.setOptional(arc.isOptional());
      this.query.addTriplePattern(pattern);
      if (arc.getLang() != null) {
        this.query.addFilter("lang(" + var +") = \"" + arc.getLang() + "\"");
      }
    }
View Full Code Here

    if (this.uri != null) {
      subject = new URIRef(this.uri);
    } else {
      subject = this.x;
    }
    this.query.addTriplePattern(new TriplePattern(subject, new AbbrevRdfType(), rdftype));
  }
View Full Code Here

    if (this.uri != null) {
      subject = new URIRef(this.uri);
    } else {
      subject = this.x;
    }
    TriplePattern pattern = new TriplePattern(subject, arc.getProperty(), new Variable(arc.getTarget()));
    pattern.setOptional(arc.isOptional());
    this.query.addTriplePattern(pattern);
  }
View Full Code Here

    if (this.uri != null) {
      subject = new URIRef(this.uri);
    } else {
      subject = this.s;
    }
    this.query.addTriplePattern(new TriplePattern(subject, new AbbrevRdfType(), rdftype));
  }
View Full Code Here

    } else {
      subject = this.s;
    }
    String uri = this.rm.getURI(obj);
    if (uri != null) {
      this.query.addTriplePattern(new TriplePattern(subject, arc.getProperty(), new URIRef(uri)));
      //FIXME: cascade
    } else {
      if (obj.toString().startsWith("http://") || obj.toString().startsWith("mailto:")) {
        this.query.addTriplePattern(new TriplePattern(subject, arc.getProperty(), new URIRef(obj.toString())));
      } else {
        this.query.addTriplePattern(new TriplePattern(subject, arc.getProperty(), new Literal(obj, arc.getLang(), arc.getDatatype())));
      }
    }
  }
View Full Code Here

  @SuppressWarnings("rawtypes")
  public Object find(String uri) {
    SelectQuery q = new SelectQuery();
    Variable x = new Variable("x");
    q.addTriplePattern(new TriplePattern(x, new AbbrevRdfType(), new Variable("type")));
    q.addFilter("str(" + x.toString() +") = \"" + uri + "\"");
    QueryCodeGenerator qg = new QueryCodeGenerator();
    qg.visit(q);
    QueryExecutor qe = this.session.getQueryExecutor();
    ResultSet rs = qe.execSelect(qg.toString());
View Full Code Here

TOP

Related Classes of org.wikier.trioo.jtrioo.rdf.sparql.TriplePattern

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.