Package org.mindswap.pellet.jena

Examples of org.mindswap.pellet.jena.NodeFormatter


  private void printTabularQueryResults() {
    // number of distinct bindings
    int count = 0;

    NodeFormatter formatter = new NodeFormatter( loader.getModel() );

    // variables used in select
    List<?> resultVars = query.getResultVars();

    List<List<String>> data = new ArrayList<List<String>>();
    while( queryResults.hasNext() ) {
      QuerySolution binding = queryResults.nextSolution();
      List<String> formattedBinding = new ArrayList<String>();
      for( int i = 0; i < resultVars.size(); i++ ) {
        String var = (String) resultVars.get( i );
        RDFNode result = binding.get( var );

        // format the result
        formattedBinding.add( formatter.format( result ) );
      }

      if( data.add( formattedBinding ) )
        count++;
    }
View Full Code Here

TOP

Related Classes of org.mindswap.pellet.jena.NodeFormatter

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.