Examples of toSPARQL()


Examples of org.apache.stanbol.rules.base.api.RuleAtom.toSPARQL()

    if(isSPARQLConstruct() || isSPARQLDelete()){
      boolean found = false;
      Iterator<RuleAtom> it = body.iterator();
      while(it.hasNext() && !found){
        RuleAtom kReSRuleAtom = it.next();
        sparql = kReSRuleAtom.toSPARQL().getObject();
        found = true;
      }
     
    }
   
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom.toSPARQL()

      for(RuleAtom kReSRuleAtom : head){
        if(!firstIte){
          sparql += " . ";
        }
        firstIte = false;
        sparql += kReSRuleAtom.toSPARQL().getObject();
      }
     
      sparql += "} ";
      sparql += "WHERE {";
     
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom.toSPARQL()

      sparql += "WHERE {";
     
      firstIte = true;
      ArrayList<SPARQLObject> sparqlObjects = new ArrayList<SPARQLObject>();
      for(RuleAtom kReSRuleAtom : body){
        SPARQLObject sparqlObject = kReSRuleAtom.toSPARQL();
        if(sparqlObject instanceof SPARQLNot){
          sparqlObjects.add((SPARQLNot) sparqlObject);
        }
        else if(sparqlObject instanceof SPARQLComparison){
          sparqlObjects.add((SPARQLComparison) sparqlObject);
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom.toSPARQL()

            sparql += " . ";
          }
          else{
            firstIte = false;
          }
          sparql += kReSRuleAtom.toSPARQL().getObject();
        }
      }
     
      firstIte = true;
     
View Full Code Here

Examples of org.apache.stanbol.rules.base.api.RuleAtom.toSPARQL()

    if(isSPARQLConstruct() || isSPARQLDelete()){
      boolean found = false;
      Iterator<RuleAtom> it = body.iterator();
      while(it.hasNext() && !found){
        RuleAtom kReSRuleAtom = it.next();
        ruleInKReSSyntax = kReSRuleAtom.toSPARQL().getObject();
        found = true;
      }
     
    }
    else{
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.DatatypeLiteral.toSPARQL()

    System.out.println("Query 3:");
    // select name of all resources with integer age of 19:
    queryString = "SELECT ?name WHERE { ?resource <"+hasAge+"> \"19\"^^<"+XSD._integer+"> . ?resource <"+hasName+"> ?name }";
    //works also:
    DatatypeLiteral nineteen = model.createDatatypeLiteral("19",XSD._integer);
    String queryString2 = "SELECT ?name WHERE { ?resource <"+hasAge+"> "+nineteen.toSPARQL()+" . ?resource <"+hasName+"> ?name }";
    assert queryString.equals(queryString2);
   
    results = model.sparqlSelect(queryString);
    for(QueryRow row : results) {
      System.out.println(row);
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral.toSPARQL()

    }
   
    // another SPARQL ASK
    System.out.println("Query 2:");
    // ask if any resource is tagged with tagComputers
    queryString = "ASK { ?resource <"+hasTag+"> "+tagComputers.toSPARQL()+" }";
    if(!model.sparqlAsk(queryString)) {
      System.out.println("nothing is tagged with "+tagComputers);
    }

  }
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.PlainLiteral.toSPARQL()

    tag(guido, tagPython);
   
    // simple SPARQL CONSTRUCT
    System.out.println("Query 1:");
    // suggest tagJava implies tagComputers
    String queryString = "CONSTRUCT { ?resource <"+hasTag+"> "+tagComputers.toSPARQL()+" } WHERE { ?resource <"+hasTag+"> "+tagJava.toSPARQL()+" }";
    ClosableIterable<? extends Statement> results = model.sparqlConstruct(queryString);
    for(Statement result : results) {
      System.out.println(result);
    }
   
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.URI.toSPARQL()

    m.addStatement(a, b, c);
    m.addStatement(a, RDF.type, c);
    log.debug("Before");
    m.dump();

    String constructRemove = "?x a " + c.toSPARQL();
    String constructAdd = "?x a " + b.toSPARQL();
    String where = constructRemove;

    SearchRemoveAddRule.searchAndReplace(m, nsMap, where, constructRemove,
        constructAdd);
View Full Code Here

Examples of org.ontoware.rdf2go.model.node.URI.toSPARQL()

    modelRDFS.open();
    URI hasTag = new URIImpl("prop://hasTag");
    URI tagSemweb = new URIImpl("tag://semweb");
    URI fileA = new URIImpl("file://a");
    modelRDFS.addStatement(fileA, hasTag, tagSemweb);
    Assert.assertTrue(modelRDFS.sparqlAsk("ASK WHERE { " + fileA.toSPARQL() + " "
            + hasTag.toSPARQL() + " ?tag . }"));
    Assert.assertTrue(modelRDFS.sparqlAsk("ASK WHERE { " + fileA.toSPARQL() + " " + " ?prop "
            + tagSemweb.toSPARQL() + " . }"));
    Assert.assertFalse(modelRDFS.sparqlAsk("ASK WHERE { " + fileA.toSPARQL() + " "
            + "<prop://bogus>" + " ?tag . }"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.