Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.Query


    if ( entities == null ) {
      entities = new ArrayList<PropertyInfo>();
    }
   
    Query query = QueryFactory.create(propertiesQuery);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
View Full Code Here


    if ( entities == null ) {
      entities = new ArrayList<ClassInfo>();
    }
   
    Query query = QueryFactory.create(CLASSES_QUERY);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
View Full Code Here

   
    // added the try-catch-warn below while further investigating 
    // http://code.google.com/p/mmisw/issues/detail?id=253
    // It happened that the CSV has a record spanning two rows; the second row started in the
    // middle of a comment, which was taken as the URI of the entity.
    Query query;
    try {
      query = QueryFactory.create(queryStr);
    }
    catch ( RuntimeException ex ) {
      log.warn("_addProps: entityUri=[" +entityUri+ "] queryStr=[" +queryStr+ "]", ex);
View Full Code Here

   
    if ( mappings == null ) {
      mappings = new ArrayList<Mapping>();
    }
   
    Query query = QueryFactory.create(SKOS_QUERY);
    QueryExecution qe = QueryExecutionFactory.create(query, ontModel);
   
    ResultSet results = qe.execSelect();
   
    while ( results.hasNext() ) {
View Full Code Here

{
    static public void main(String...argv)
    {
        try {
            String queryStr = "select distinct ?Concept where {[] a ?Concept} LIMIT 10";
            Query query = QueryFactory.create(queryStr);

            // Remote execution.
            QueryExecution qexec = QueryExecutionFactory.sparqlService("http://dbpedia.org/sparql", query);
            // Set the DBpedia specific timeout.
            ((QueryEngineHTTP)qexec).addParam("timeout", "10000") ;
View Full Code Here

public class TestVarScope extends BaseTest
{
    private static void scope(String queryStr)
    {
        Query query = QueryFactory.create(queryStr) ;
        SyntaxVarScope.check(query) ;
    }
View Full Code Here

    }
   
    @Override
    protected void runTestForReal() throws Throwable
    {
        Query query = null ;
        try {
            try { query = queryFromTestItem(testItem) ; }
            catch (QueryException qEx)
            {
                query = null ;
                qEx.printStackTrace(System.err) ;
                fail("Parse failure: "+qEx.getMessage()) ;
                throw qEx ;
            }

            Dataset dataset = setUpDataset(query, testItem) ;
            if ( dataset == null && ! doesQueryHaveDataset(query) )
                fail("No dataset for query") ;

            QueryExecution qe = null ;
           
            if ( dataset == null )
                qe = QueryExecutionFactory.create(query, queryFileManager) ;
            else
                qe = QueryExecutionFactory.create(query, dataset) ;
           
            try {
                if ( query.isSelectType() )
                    runTestSelect(query, qe) ;
                else if ( query.isConstructType() )
                    runTestConstruct(query, qe) ;
                else if ( query.isDescribeType() )
                    runTestDescribe(query, qe) ;
                else if ( query.isAskType() )
                    runTestAsk(query, qe) ;
            } finally { qe.close() ; }
        }
        catch (IOException ioEx)
        {
View Full Code Here

    }
   
    private static void check(String queryString, String opExpectedString)
    {
        queryString = "PREFIX : <http://example/>\n"+queryString ;
        Query query = QueryFactory.create(queryString) ;
        Op opQuery = Algebra.compile(query) ;
        check(opQuery, opExpectedString) ;
    }
View Full Code Here

        return query(string, m, null, null) ;
    }

    private static ResultSet query(String string, Model m, String varName, RDFNode value)
    {
        Query query = QueryFactory.create(prefixes+string) ;
        QuerySolutionMap initValues = null ;
        if ( varName != null )
            initValues = querySolution(varName, value) ;
        QueryExecution qExec = QueryExecutionFactory.create(query, m, initValues) ;
        ResultSet rs = ResultSetFactory.copyResults(qExec.execSelect()) ;
View Full Code Here

    private void execute(String queryString, HttpActionQuery action)
    {
        String queryStringLog = formatForLog(queryString) ;
        log.info(format("[%d] Query = %s", action.id, queryStringLog));

        Query query = null ;
        try {
            // NB syntax is ARQ (a superset of SPARQL)
            query = QueryFactory.create(queryString, Syntax.syntaxARQ) ;
            queryStringLog = formatForLog(query) ;
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.Query

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.