private List < Assertion > processResults ( OntopBindingSet bindingSet ) throws OntopResultConversionException , OntopConnectionException { List < Assertion > tripleAssertions = new ArrayList <> ( ) ; ABoxAssertionSupplier builder = OntologyBuilderImpl . assertionSupplier ( rdfFactory ) ; for ( ProjectionElemList peList : constructTemplate . getProjectionElemList ( ) ) { int size = peList . getElements ( ) . size ( ) ; for ( int i = 0 ; i < size / 3 ; i ++ ) { ObjectConstant subjectConstant = ( ObjectConstant ) getConstant ( peList . getElements ( ) . get ( i * 3 ) , bindingSet ) ; Constant predicateConstant = getConstant ( peList . getElements ( ) . get ( i * 3 + 1 ) , bindingSet ) ; Constant objectConstant = getConstant ( peList . getElements ( ) . get ( i * 3 + 2 ) , bindingSet ) ; // A triple can only be constructed when none of bindings is missing if ( subjectConstant == null || predicateConstant == null || objectConstant == null ) { continue ; } // Determines the type of assertion String predicateName = predicateConstant . getValue ( ) ; try { Assertion assertion ; if ( predicateName . equals ( RDF . TYPE . getIRIString ( ) ) ) { assertion = builder . createClassAssertion ( objectConstant . getValue ( ) , subjectConstant ) ; } else { if ( ( objectConstant instanceof IRIConstant ) || ( objectConstant instanceof BNode ) ) { assertion = builder . createObjectPropertyAssertion ( predicateName , subjectConstant , ( ObjectConstant ) objectConstant ) ; } else { assertion = builder . createDataPropertyAssertion ( predicateName , subjectConstant , ( ValueConstant ) objectConstant ) ; } } if ( assertion != null ) tripleAssertions . add ( assertion ) ; } catch ( InconsistentOntologyException e ) { throw new OntopResultConversionException ( "InconsistentOntologyException: " + predicateName + " " + subjectConstant + " " + objectConstant ) ; } } } return tripleAssertions ; }
The method to actually process the current result set Row . Construct a list of assertions from the current result set row . In case of describe it is called to process and store all the results from a resultset . In case of construct it is called upon next to process the only current result set .