Package com.clarkparsia.empire

Examples of com.clarkparsia.empire.Dialect


      if (aURI != null) {
        aNG = aURI.toString();
      }
    }

    Dialect aDialect = theSource.getQueryFactory().getDialect();

    String aSPARQL = "select distinct ?s\n" +
             (aNG == null ? "" : "from <" + aNG + ">\n") +
             "where {?s ?p ?o. filter(?s = " + aDialect.asQueryString(EmpireUtil.asResource(EmpireUtil.asSupportsRdfId(theObj))) + ") } limit 1";

    String aSeRQL = "select distinct s\n" +
             (aNG == null ? "from\n" : "from context <" + aNG + ">\n") +
             "{s} p {o} where s = " + aDialect.asQueryString(EmpireUtil.asResource(EmpireUtil.asSupportsRdfId(theObj))) + " limit 1";

    ResultSet aResults;

    if (theSource.getQueryFactory().getDialect() instanceof SerqlDialect) {
      aResults = theSource.selectQuery(aSeRQL);
View Full Code Here


      if (aURI != null) {
        aNG = aURI.toString();
      }
    }

    Dialect aDialect = theSource.getQueryFactory().getDialect();

    Resource aResource = EmpireUtil.asResource(EmpireUtil.asSupportsRdfId(theObj));

    // bnode instabilty in queries will just yield either a parse error or incorrect query results because the bnode
    // will get treated as a variable, and it will just grab the entire database, which is not what we want
    if (aResource instanceof BNode && !(aDialect instanceof ARQSPARQLDialect)) {
      return Graphs.newGraph();
    }

    // TODO: if source supports describe queries, use that.

    String aSPARQL = "construct {?s ?p ?o}\n" +
             (aNG == null ? "" : "from <" + aNG + ">\n") +
             "where {?s ?p ?o. filter(?s = " + aDialect.asQueryString(aResource) + ") }";


    String aSeRQL = "construct {s} p {o}\n" +
             (aNG == null ? "from\n" : "from context <" + aNG + ">\n") +
             "{s} p {o} where s = " + aDialect.asQueryString(aResource) + "";

    Graph aGraph;

    if (theSource.getQueryFactory().getDialect() instanceof SerqlDialect) {
      aGraph = theSource.graphQuery(aSeRQL);
View Full Code Here

      return theMethod.invoke(mProxy.value(), theArgs);
    }
  }
 
  private static String getBNodeConstructQuery(DataSource theSource, Resource theRes, URI theProperty) {
    Dialect aDialect = theSource.getQueryFactory().getDialect();

    String aSerqlQuery = "construct * from {" + aDialect.asQueryString(theRes) + "} <" + theProperty.toString() + "> {o}, {o} po {oo}";

    String aSparqlQuery = "CONSTRUCT  { " + aDialect.asQueryString(theRes) + " <"+theProperty.toString()+"> ?o . ?o ?po ?oo  } \n" +
                "WHERE\n" +
                "{ " + aDialect.asQueryString(theRes) + " <" + theProperty.toString() + "> ?o.\n" +
                "?o ?po ?oo. }";

    if (theSource.getQueryFactory().getDialect() instanceof SerqlDialect) {
      return aSerqlQuery;
    }
View Full Code Here

TOP

Related Classes of com.clarkparsia.empire.Dialect

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.