Input:
Returns collection that contains at least all individuals that are in taxonomy but either are removed from ontology or their context became not saturated . [CODESPLIT] Collection < IndexedIndividual > getToRemove ( ) { if ( taxonomy_ == null ) { // TODO: Never set taxonomy_ to null !!! // no individuals are in taxonomy toRemove_ . clear ( ) ; return Collections . emptyList ( ) ; } // else final int size = pruneToRemove ( ) ; /*
		 * since getting the size of the queue is a linear operation, use the
		 * computed size
		 */ return Operations . getCollection ( toRemove_ , size ) ; }


Input: Obtain a { @link TypeNode } object for a given { @link ElkClass } or { @code null } if none assigned . [CODESPLIT] @ Override public IndividualNode . Projection < ElkClass , ElkNamedIndividual > getInstanceNode ( final ElkNamedIndividual individual ) { return individualNodeStore_ . getNode ( individual ) ; }


Input: @param factory the factory for creating conclusions [CODESPLIT] public BackwardLink getConclusion ( BackwardLink . Factory factory ) { return factory . getBackwardLink ( getDestination ( ) , conclusionRelation_ , conclusionSource_ ) ; }


Input:
Logs a warning message for unsupported OWL API method [CODESPLIT] private static UnsupportedOperationException unsupportedOwlApiMethod ( String method ) { String message = "OWL API reasoner method is not implemented: " + method + "." ; /*
		 * TODO: The method String can be used to create more specific message
		 * types, but with the current large amount of unsupported methods and
		 * non-persistent settings for ignoring them, we better use only one
		 * message type to make it easier to ignore them.
		 */ LoggerWrap . log ( LOGGER_ , LogLevel . WARN , MARKER_UNSUPPORTED_METHOD_ , message ) ; return new UnsupportedOperationException ( message ) ; }


Input: / * Methods required by the OWLReasoner interface [CODESPLIT] @ Override public void dispose ( ) { LOGGER_ . trace ( "dispose()" ) ; owlOntologymanager_ . removeOntologyChangeListener ( ontologyChangeListener_ ) ; owlOntologymanager_ . removeOntologyChangeProgessListener ( ontologyChangeProgressListener_ ) ; try { for ( ; ; ) { try { if ( ! reasoner_ . shutdown ( ) ) throw new ReasonerInternalException ( "Failed to shut down ELK!" ) ; break ; } catch ( InterruptedException e ) { continue ; } } } catch ( ElkRuntimeException e ) { throw elkConverter_ . convert ( e ) ; } }


Input: Computes the initial capacity of the table for storing elements . The capacity is the largest power of two that does not exceed the given value or { @link #MAXIMUM_CAPACITY } . [CODESPLIT] static int getInitialCapacity ( int capacity ) { if ( capacity < 0 ) throw new IllegalArgumentException ( "Illegal Capacity: " + capacity ) ; if ( capacity > LinearProbing . MAXIMUM_CAPACITY ) capacity = LinearProbing . MAXIMUM_CAPACITY ; // Find a power of 2 >= initialCapacity int result = 1 ; while ( result < capacity ) result <<= 1 ; return result ; }


Input: Removes the element at the given position of the table shifting if necessary other elements so that all elements can be found by linear probing . [CODESPLIT] static < E > void remove ( E [ ] d , int pos ) { for ( ; ; ) { int next = getMovedPosition ( d , pos ) ; E moved = d [ pos ] = d [ next ] ; if ( moved == null ) return ; // else pos = next ; } }


Input: Removes the element at the given position of the table and the corresponding value at the same position shifting if necessary other elements and values so that all elements can be found by linear probing . [CODESPLIT] static < K , V > void remove ( K [ ] k , V [ ] v , int pos ) { for ( ; ; ) { int next = getMovedPosition ( k , pos ) ; K moved = k [ pos ] = k [ next ] ; v [ pos ] = v [ next ] ; if ( moved == null ) return ; // else pos = next ; } }


Input: Finds the position of the next element starting from the given position that would not be found by linear probing if the element at the given position are deleted . This should be the element whose index is smaller than this position . [CODESPLIT] static < E > int getMovedPosition ( E [ ] d , int del ) { int j = del ; for ( ; ; ) { if ( ++ j == d . length ) j = 0 ; // invariant: interval ]del, j] contains only non-null elements // whose index is in ]del, j] E test = d [ j ] ; if ( test == null ) return j ; int k = getIndex ( test , d . length ) ; // check if k is in ]del, j] (this interval can wrap over) if ( ( del < j ) ? ( del < k ) && ( k <= j ) : ( del < k ) || ( k <= j ) ) // the test element should not be shifted continue ; // else it should be shifted return j ; } }


Input: Tests if the set represented by given data array contains a given object . [CODESPLIT] static < E > boolean contains ( E [ ] d , Object o ) { int pos = getPosition ( d , o ) ; if ( d [ pos ] == null ) return false ; // else return true ; }


Input: Adds the element to the set represented by given data array if it did not contain there already . [CODESPLIT] static < E > boolean add ( E [ ] d , E e ) { int pos = getPosition ( d , e ) ; if ( d [ pos ] == null ) { d [ pos ] = e ; return true ; } // else the element is already there return false ; }


Input: verifies that occurrence numbers are not negative [CODESPLIT] public final void checkOccurrenceNumbers ( ) { if ( LOGGER_ . isTraceEnabled ( ) ) LOGGER_ . trace ( toString ( ) + " occurences: " + printOccurrenceNumbers ( ) ) ; if ( positiveOccurrenceNo < 0 || negativeOccurrenceNo < 0 ) throw new ElkUnexpectedIndexingException ( toString ( ) + " has a negative occurrence: " + printOccurrenceNumbers ( ) ) ; }


Input: TODO : perhaps convert using some visitor [CODESPLIT] public OWLRuntimeException convert ( ElkException e ) { if ( e instanceof ElkFreshEntitiesException ) return convert ( ( ElkFreshEntitiesException ) e ) ; else if ( e instanceof ElkInconsistentOntologyException ) return convert ( ( ElkInconsistentOntologyException ) e ) ; else if ( e instanceof ElkInterruptedException ) return convert ( ( ElkInterruptedException ) e ) ; else return new OWLRuntimeException ( e ) ; }


Input: Adds all timers of the argument to the corresponding counters of this object . The timers should not be directly modified other than using this method during this operation . The timers in the argument will be reseted after this operation . [CODESPLIT] public synchronized void add ( ClassConclusionTimer timer ) { this . timeComposedSubsumers += timer . timeComposedSubsumers ; this . timeDecomposedSubsumers += timer . timeDecomposedSubsumers ; this . timeBackwardLinks += timer . timeBackwardLinks ; this . timeForwardLinks += timer . timeForwardLinks ; this . timeContradictions += timer . timeContradictions ; this . timePropagations += timer . timePropagations ; this . timeDisjointSubsumers += timer . timeDisjointSubsumers ; this . timeContextInitializations += timer . timeContextInitializations ; this . timeSubContextInitializations += timer . timeSubContextInitializations ; }


Input: TODO : simplify the implementation to use just one weak wrapper [CODESPLIT] @ SuppressWarnings ( "unchecked" ) @ Override protected < C extends ElkObject > C filter ( C candidate ) { if ( candidate instanceof ElkEntity ) return ( C ) getCanonicalElkEntity ( ( ElkEntity ) candidate ) ; else return candidate ; }


Input: Add the values the corresponding values of the given timer [CODESPLIT] public synchronized void add ( RuleApplicationTimer timer ) { timeOwlThingContextInitRule += timer . timeOwlThingContextInitRule ; timeRootContextInitializationRule += timer . timeRootContextInitializationRule ; timeDisjointSubsumerFromMemberRule += timer . timeDisjointSubsumerFromMemberRule ; timeContradictionFromNegationRule += timer . timeContradictionFromNegationRule ; timeObjectIntersectionFromFirstConjunctRule += timer . timeObjectIntersectionFromFirstConjunctRule ; timeObjectIntersectionFromSecondConjunctRule += timer . timeObjectIntersectionFromSecondConjunctRule ; timeSuperClassFromSubClassRule += timer . timeSuperClassFromSubClassRule ; timePropagationFromExistentialFillerRule += timer . timePropagationFromExistentialFillerRule ; timeObjectUnionFromDisjunctRule += timer . timeObjectUnionFromDisjunctRule ; timeBackwardLinkChainFromBackwardLinkRule += timer . timeBackwardLinkChainFromBackwardLinkRule ; timeReflexiveBackwardLinkCompositionRule += timer . timeReflexiveBackwardLinkCompositionRule ; timeNonReflexiveBackwardLinkCompositionRule += timer . timeNonReflexiveBackwardLinkCompositionRule ; timeSubsumerBackwardLinkRule += timer . timeSubsumerBackwardLinkRule ; timeContradictionOverBackwardLinkRule += timer . timeContradictionOverBackwardLinkRule ; timeContradictionPropagationRule += timer . timeContradictionPropagationRule ; timeContradictionCompositionRule += timer . timeContradictionCompositionRule ; timeIndexedObjectIntersectionOfDecomposition += timer . timeIndexedObjectIntersectionOfDecomposition ; timeIndexedObjectSomeValuesFromDecomposition += timer . timeIndexedObjectSomeValuesFromDecomposition ; timeIndexedObjectComplementOfDecomposition += timer . timeIndexedObjectComplementOfDecomposition ; timeIndexedObjectHasSelfDecomposition += timer . timeIndexedObjectHasSelfDecomposition ; timeContradictionFromOwlNothingRule += timer . timeContradictionFromOwlNothingRule ; timeSubsumerPropagationRule += timer . timeSubsumerPropagationRule ; timePropagationInitializationRule += timer . timePropagationInitializationRule ; timeBackwardLinkFromForwardLinkRule += timer . timeBackwardLinkFromForwardLinkRule ; timeComposedFromDecomposedSubsumerRule += timer . timeComposedFromDecomposedSubsumerRule ; timeIndexedClassDecompositionRule += timer . timeIndexedClassDecompositionRule ; timeIndexedClassFromDefinitionRule += timer . timeIndexedClassFromDefinitionRule ; timeEquivalentClassFirstFromSecondRule += timer . timeEquivalentClassFirstFromSecondRule ; timeEquivalentClassSecondFromFirstRule += timer . timeEquivalentClassSecondFromFirstRule ; }


Input: logging is switched off [CODESPLIT] @ Override protected Boolean defaultVisit ( ClassConclusion conclusion ) { ClassConclusionSet conclusions = conclusionsRef_ . get ( ) ; boolean result = conclusions == null ? false : conclusions . containsConclusion ( conclusion ) ; if ( LOGGER_ . isTraceEnabled ( ) ) { LOGGER_ . trace ( "{}: check occurrence of {}: {}" , conclusions , conclusion , result ? "success" : "failure" ) ; } return result ; }


Input:
Creates stage that computes object property taxonomy . [CODESPLIT] AbstractReasonerStage createStage ( final AbstractReasonerState reasoner , final AbstractReasonerStage ... preStages ) { return new AbstractReasonerStage ( reasoner , preStages ) { /**
			 * The computation used for this stage.
			 */ private ObjectPropertyTaxonomyComputation computation_ = null ; @ Override public String getName ( ) { return "Object Property Taxonomy Computation" ; } @ Override public boolean preExecute ( ) { if ( ! super . preExecute ( ) ) { return false ; } resetTaxonomy ( ) ; computation_ = new ObjectPropertyTaxonomyComputation ( reasoner . ontologyIndex , reasoner . getInterrupter ( ) , transitiveReductionOutputProcessor_ , reasoner . getElkFactory ( ) , reasoner . getProcessExecutor ( ) , workerNo , reasoner . getProgressMonitor ( ) ) ; return true ; } @ Override void executeStage ( ) throws ElkException { computation_ . process ( ) ; } @ Override public boolean postExecute ( ) { if ( ! super . postExecute ( ) ) { return false ; } this . computation_ = null ; return true ; } @ Override public void printInfo ( ) { // TODO Auto-generated method stub } } ; }


Input: @param factory the factory for creating conclusions [CODESPLIT] public ForwardLink getConclusion ( ForwardLink . Factory factory ) { return factory . getForwardLink ( getDestination ( ) , existential_ . getProperty ( ) , getOrigin ( ) ) ; }


Input: Add an { @link OwlThingContextInitRule } to the given { @link ModifiableOntologyIndex } [CODESPLIT] public static boolean addRuleFor ( IndexedClass owlThing , ModifiableOntologyIndex index ) { LOGGER_ . trace ( "{}: adding {}" , owlThing , NAME ) ; return index . addContextInitRule ( new OwlThingContextInitRule ( owlThing ) ) ; }


Input: Removes an { @link OwlThingContextInitRule } from the given { @link ModifiableOntologyIndex } [CODESPLIT] public static boolean removeRuleFor ( IndexedClass owlThing , ModifiableOntologyIndex index ) { LOGGER_ . trace ( "{}: removing {}" , owlThing , NAME ) ; return index . removeContextInitRule ( new OwlThingContextInitRule ( owlThing ) ) ; }


Input: Associates the given key with the given value in the map defined by the keys and value arrays . If an entry with the key equal to the given one already exists in the map the value for this key will be overwritten with the given value . [CODESPLIT] private static < K , V > V putKeyValue ( K [ ] keys , V [ ] values , K key , V value ) { int pos = LinearProbing . getPosition ( keys , key ) ; if ( keys [ pos ] == null ) { keys [ pos ] = key ; values [ pos ] = value ; return null ; } // else V oldValue = values [ pos ] ; values [ pos ] = value ; return oldValue ; }


Input: Remove the entry in the keys and values such that the key of the entry is equal to the given object according to the equality function . [CODESPLIT] private static < K , V > V removeEntry ( K [ ] keys , V [ ] values , Object key ) { int pos = LinearProbing . getPosition ( keys , key ) ; if ( keys [ pos ] == null ) return null ; // else V result = values [ pos ] ; LinearProbing . remove ( keys , values , pos ) ; return result ; }


Input: Increasing the capacity of the map [CODESPLIT] private void enlarge ( ) { int oldCapacity = keys . length ; if ( oldCapacity == LinearProbing . MAXIMUM_CAPACITY ) throw new IllegalArgumentException ( "Map cannot grow beyond capacity: " + LinearProbing . MAXIMUM_CAPACITY ) ; K oldKeys [ ] = keys ; V oldValues [ ] = values ; int newCapacity = oldCapacity << 1 ; @ SuppressWarnings ( "unchecked" ) K newKeys [ ] = ( K [ ] ) new Object [ newCapacity ] ; @ SuppressWarnings ( "unchecked" ) V newValues [ ] = ( V [ ] ) new Object [ newCapacity ] ; for ( int i = 0 ; i < oldCapacity ; i ++ ) { K key = oldKeys [ i ] ; if ( key != null ) putKeyValue ( newKeys , newValues , key , oldValues [ i ] ) ; } this . keys = newKeys ; this . values = newValues ; }


Input: Decreasing the capacity of the map [CODESPLIT] private void shrink ( ) { int oldCapacity = keys . length ; if ( oldCapacity <= LinearProbing . DEFAULT_INITIAL_CAPACITY ) return ; K oldKeys [ ] = keys ; V oldValues [ ] = values ; int newCapacity = oldCapacity >> 1 ; @ SuppressWarnings ( "unchecked" ) K newKeys [ ] = ( K [ ] ) new Object [ newCapacity ] ; @ SuppressWarnings ( "unchecked" ) V newValues [ ] = ( V [ ] ) new Object [ newCapacity ] ; for ( int i = 0 ; i < oldCapacity ; i ++ ) { K key = oldKeys [ i ] ; if ( key != null ) putKeyValue ( newKeys , newValues , key , oldValues [ i ] ) ; } this . keys = newKeys ; this . values = newValues ; }


Input:
Not a thread - safe method . Shouldn t be invoked concurrently . [CODESPLIT] public void saveConfiguration ( File configOnDisk , BaseConfiguration config ) throws ConfigurationException , IOException { /*
		 * Unfortunately, we can't directly write the config on disk because the
		 * parameters in it may be just a subset of those on disk. So we load it
		 * first (alternatively one may use a singleton, which I typically try
		 * to avoid). It should work reasonably well unless there're too many
		 * parameters (in which case we should think of a mini key-value store).
		 */ InputStream stream = null ; BaseConfiguration loadedConfig = null ; Properties diskProps = new Properties ( ) ; try { stream = new FileInputStream ( configOnDisk ) ; loadedConfig = getConfiguration ( stream , "" , config . getClass ( ) ) ; // copy parameters copyParameters ( loadedConfig , diskProps ) ; } catch ( Throwable e ) { LOGGER_ . info ( "Overwriting configuration since it can't be loaded (perhaps doesn't exist?)" ) ; } finally { IOUtils . closeQuietly ( stream ) ; } copyParameters ( config , diskProps ) ; // now save it to the file saveProperties ( diskProps , configOnDisk ) ; }


Input: Searches for the next non - { @code null } element after the given position before the start position [CODESPLIT] int seekNext ( int pos ) { for ( ; ; ) { if ( ++ pos == dataSnapshot . length ) pos = 0 ; if ( pos == start_ || isOccupied ( pos ) ) return pos ; } }


Input: prints SubClassOf ( A owl : Thing ) for all direct subclasses of owl : Thing [CODESPLIT] static void printClassTaxonomy ( Taxonomy < ElkClass > taxonomy , File out ) throws IOException { FileWriter fstream = null ; BufferedWriter writer = null ; try { fstream = new FileWriter ( out ) ; writer = new BufferedWriter ( fstream ) ; writer . append ( "Ontology(\n" ) ; processTaxomomy ( taxonomy , writer ) ; writer . append ( ")\n" ) ; writer . flush ( ) ; } finally { IOUtils . closeQuietly ( fstream ) ; IOUtils . closeQuietly ( writer ) ; } }


Input: Prints class declarations [CODESPLIT] protected static void printDeclarations ( Taxonomy < ElkClass > classTaxonomy , ElkObject . Factory objectFactory , Appendable writer ) throws IOException { List < ElkClass > classes = new ArrayList < ElkClass > ( classTaxonomy . getNodes ( ) . size ( ) * 2 ) ; for ( TaxonomyNode < ElkClass > classNode : classTaxonomy . getNodes ( ) ) { for ( ElkClass clazz : classNode ) { if ( ! clazz . getIri ( ) . equals ( PredefinedElkIris . OWL_THING ) && ! clazz . getIri ( ) . equals ( PredefinedElkIris . OWL_NOTHING ) ) { classes . add ( clazz ) ; } } } Collections . sort ( classes , CLASS_COMPARATOR ) ; for ( ElkClass clazz : classes ) { ElkDeclarationAxiom decl = objectFactory . getDeclarationAxiom ( clazz ) ; OwlFunctionalStylePrinter . append ( writer , decl , true ) ; writer . append ( ' ' ) ; } }


Input: Returns all super - nodes of a node whose direct super - nodes are <code > direct< / code > . [CODESPLIT] public static < T extends ElkEntity , N extends GenericTaxonomyNode < T , N > > Set < ? extends N > getAllSuperNodes ( final Collection < ? extends N > direct ) { return getAllReachable ( direct , new Functor < N , Set < ? extends N > > ( ) { @ Override public Set < ? extends N > apply ( final N node ) { return node . getDirectSuperNodes ( ) ; } } ) ; }


Input: Returns all sub - nodes of a node whose direct sub - nodes are <code > direct< / code > . [CODESPLIT] public static < T extends ElkEntity , N extends GenericTaxonomyNode < T , N > > Set < ? extends N > getAllSubNodes ( final Collection < ? extends N > direct ) { return getAllReachable ( direct , new Functor < N , Set < ? extends N > > ( ) { @ Override public Set < ? extends N > apply ( final N node ) { return node . getDirectSubNodes ( ) ; } } ) ; }


Input: Returns all instance nodes of the specified type node and all its sub - nodes . [CODESPLIT] public static < T extends ElkEntity , I extends ElkEntity , TN extends GenericTypeNode < T , I , TN , IN > , IN extends GenericInstanceNode < T , I , TN , IN > > Set < ? extends IN > getAllInstanceNodes ( final GenericTypeNode < T , I , TN , IN > node ) { return TaxonomyNodeUtils . collectFromAllReachable ( node . getDirectSubNodes ( ) , node . getDirectInstanceNodes ( ) , new Operations . Functor < GenericTypeNode < T , I , TN , IN > , Set < ? extends GenericTypeNode < T , I , TN , IN > > > ( ) { @ Override public Set < ? extends TN > apply ( final GenericTypeNode < T , I , TN , IN > node ) { return node . getDirectSubNodes ( ) ; } } , new Operations . Functor < GenericTypeNode < T , I , TN , IN > , Set < ? extends IN > > ( ) { @ Override public Set < ? extends IN > apply ( final GenericTypeNode < T , I , TN , IN > node ) { return node . getDirectInstanceNodes ( ) ; } } ) ; }


Input: Creates a { @link Chain } view of the value associated with the given key in the given { @link Map } . The values of the map must be instances of the type that can be used in the { @link Chain } interface . All operations with the returned { @link Chain } such as addition or removal will be reflected accordingly in the corresponding value in the { @link Map } . [CODESPLIT] public static < K , T extends ModifiableLink < T > > Chain < T > getMapBackedChain ( final Map < K , T > map , final K key ) { return new AbstractChain < T > ( ) { @ Override public T next ( ) { return map . get ( key ) ; } @ Override public void setNext ( T next ) { if ( next == null ) map . remove ( key ) ; else map . put ( key , next ) ; } } ; }


Input: Finds and returns the entry in set that is structurally equal to the input entry if there is one . Equality of entries is decided using { @link Entry#structuralHashCode () } and { @link Entry#structuralEquals ( Object ) } methods . [CODESPLIT] public < T extends Entry < T , ? > > T findStructural ( Entry < T , ? > entry ) { int h = entry . structuralHashCode ( ) ; int i = indexFor ( h , buckets . length ) ; T result = null ; for ( E r = buckets [ i ] ; r != null ; r = r . getNext ( ) ) { if ( r . structuralHashCode ( ) == h && ( result = entry . structuralEquals ( r ) ) != null ) return result ; } // else fail return null ; }


Input: Adds the given entry to this collection ; the entry is added even if a structurally equal entry ( modulo { @link Entry#structuralHashCode () } and { @link Entry#structuralEquals ( Object ) } ) is already present in the collection [CODESPLIT] public void addStructural ( E entry ) { if ( entry . getNext ( ) != null ) throw new IllegalArgumentException ( "The given entry should be fresh!" ) ; int h = entry . structuralHashCode ( ) ; int i = indexFor ( h , buckets . length ) ; modCount ++ ; E e = buckets [ i ] ; entry . setNext ( e ) ; buckets [ i ] = entry ; if ( size ++ >= oversize ) resize ( 2 * buckets . length ) ; }


Input: Removes and returns the entry in the set that is structurally equal to the specified entry . Returns { @code null } if the set contains no such entry . Equality of entries is decided using { @link Entry#structuralHashCode () } and { @link Entry#structuralEquals ( Object ) } methods . [CODESPLIT] public < T extends Entry < T , ? > > T removeStructural ( Entry < T , ? > entry ) { int h = entry . structuralHashCode ( ) ; int i = indexFor ( h , buckets . length ) ; E prev = buckets [ i ] ; E r = prev ; T result = null ; while ( r != null ) { E next = r . getNext ( ) ; if ( r . structuralHashCode ( ) == h && ( result = entry . structuralEquals ( r ) ) != null ) { modCount ++ ; if ( prev == r ) buckets [ i ] = next ; else prev . setNext ( next ) ; if ( size -- <= undersize && buckets . length >= 2 * minsize ) resize ( buckets . length / 2 ) ; return result ; } prev = r ; r = next ; } // not found return null ; }


Input: Rehashes the contents of this map into a new array with a new capacity . This method is called automatically when the number of entries in this set becomes below the { @link #undersize } or above the { @link #oversize } . [CODESPLIT] void resize ( int newCapacity ) { E [ ] oldTable = buckets ; int oldCapacity = oldTable . length ; if ( oldCapacity == MAXIMUM_CAPACITY ) { oversize = Integer . MAX_VALUE ; oversize = ( int ) ( newCapacity * overloadFactor ) ; return ; } @ SuppressWarnings ( "unchecked" ) E [ ] newTable = ( E [ ] ) new Entry [ newCapacity ] ; transfer ( newTable ) ; buckets = newTable ; undersize = ( int ) ( newCapacity * underloadFactor ) ; oversize = ( int ) ( newCapacity * overloadFactor ) ; }


Input: Removes all entries from this set . The set will be empty after this call returns . [CODESPLIT] @ Override public void clear ( ) { modCount ++ ; E [ ] tab = buckets ; for ( int i = 0 ; i < tab . length ; i ++ ) tab [ i ] = null ; size = 0 ; }


Input: logging is switched off [CODESPLIT] @ Override protected Boolean defaultVisit ( ClassConclusion conclusion ) { ClassConclusionSet conclusions = conclusionsRef . get ( ) ; boolean result = conclusions . removeConclusion ( conclusion ) ; if ( LOGGER_ . isTraceEnabled ( ) ) { LOGGER_ . trace ( "{}: deleting {}: {}" , conclusions , conclusion , result ? "success" : "failure" ) ; } return result ; }


Input: @param factory the factory for creating conclusions [CODESPLIT] public final Propagation getConclusion ( Propagation . Factory factory ) { return factory . getPropagation ( getDestination ( ) , getRelation ( ) , getCarry ( ) ) ; }


Input: Compute the combined hash code of several objects using their { @link #hashCode () } functions . The combined hash code depends on the order in which the objects are listed . [CODESPLIT] public static int combinedHashCode ( Object ... objects ) { int result = 0 ; for ( Object obj : objects ) { int h = obj . hashCode ( ) ; result += h ; result += ( h << 10 ) ; result ^= ( h >> 6 ) ; } result += ( result << 3 ) ; result ^= ( result >> 11 ) ; result += ( result << 15 ) ; return result ; }


Input: Combine many hash codes with an associative commutative hash function . Associativity ensures that the result of this functions can be further combined with other hash codes for getting the same result as if all hash codes had been combined in one step . [CODESPLIT] public static int combineMultisetHash ( boolean finalize , int ... hashes ) { int hash = 0 ; for ( int h : hashes ) { hash = hash + h ; } if ( finalize ) { hash = combineListHash ( hash ) ; } return hash ; }


Input: Combine the hash codes of a collection of objects with an associative commutative hash function . Associativity ensures that the result of this functions can be further combined with other hash codes for getting the same result as if all hash codes had been combined in one step . [CODESPLIT] public static < T > int combineMultisetHash ( boolean finalize , Iterable < ? extends T > hashObjects , Hasher < T > hasher ) { return combineMultisetHash ( finalize , hashObjects . iterator ( ) , hasher ) ; }


Input: Combine the hash codes of a collection of objects with an associative commutative hash function . Associativity ensures that the result of this functions can be further combined with other hash codes for getting the same result as if all hash codes had been combined in one step . [CODESPLIT] public static < T > int combineMultisetHash ( boolean finalize , Iterator < ? extends T > hashObjectIterator , Hasher < T > hasher ) { int hash = 0 ; while ( hashObjectIterator . hasNext ( ) ) { hash += hasher . hash ( hashObjectIterator . next ( ) ) ; } if ( finalize ) { hash = combineListHash ( hash ) ; } return hash ; }


Input: Combine many hash codes into one in a way that depends on their order . [CODESPLIT] public static int combineListHash ( int ... hashes ) { int hash = 0 ; for ( int h : hashes ) { hash += h ; hash += ( hash << 10 ) ; hash ^= ( hash >> 6 ) ; } hash += ( hash << 3 ) ; hash ^= ( hash >> 11 ) ; hash += ( hash << 15 ) ; return hash ; }


Input: Combine the hash codes of a collection of objects into one in a way that depends on their order . [CODESPLIT] public static < T > int combineListHash ( List < ? extends T > hashObjects , Hasher < T > hasher ) { return combineListHash ( hashObjects . iterator ( ) , hasher ) ; }


Input: Combine the hash codes of a collection of objects into one in a way that depends on their order . [CODESPLIT] public static < T > int combineListHash ( Iterator < ? extends T > hashObjectIterator , Hasher < T > hasher ) { int hash = 0 ; while ( hashObjectIterator . hasNext ( ) ) { hash += hasher . hash ( hashObjectIterator . next ( ) ) ; hash += ( hash << 10 ) ; hash ^= ( hash >> 6 ) ; } hash += ( hash << 3 ) ; hash ^= ( hash >> 11 ) ; hash += ( hash << 15 ) ; return hash ; }


Input: Copies bytes from the input stream to the output stream [CODESPLIT] public static int copy ( InputStream input , OutputStream output ) throws IOException { byte [ ] buffer = new byte [ BUFFER_SIZE ] ; BufferedInputStream in = new BufferedInputStream ( input , BUFFER_SIZE ) ; BufferedOutputStream out = new BufferedOutputStream ( output , BUFFER_SIZE ) ; int count = 0 , n = 0 ; try { while ( ( n = in . read ( buffer , 0 , BUFFER_SIZE ) ) != - 1 ) { out . write ( buffer , 0 , n ) ; count += n ; } out . flush ( ) ; } finally { IOUtils . closeQuietly ( in ) ; IOUtils . closeQuietly ( out ) ; } return count ; }


Input: Retrieves a set of resource names from a JAR file ( the code source for the given Java class ) [CODESPLIT] public static List < String > getResourceNamesFromJAR ( String path , String extension , Class < ? > clazz ) throws IOException { CodeSource src = clazz . getProtectionDomain ( ) . getCodeSource ( ) ; List < String > testResources = new ArrayList < String > ( ) ; ZipInputStream zip = null ; if ( src != null ) { URL jar = src . getLocation ( ) ; ZipEntry ze = null ; try { zip = new ZipInputStream ( jar . openStream ( ) ) ; while ( ( ze = zip . getNextEntry ( ) ) != null ) { String entryName = ze . getName ( ) ; if ( entryName . startsWith ( path ) && entryName . endsWith ( "." + extension ) ) { testResources . add ( entryName ) ; } } } finally { closeQuietly ( zip ) ; } } else { throw new IOException ( "Unable to get code source for " + clazz . getSimpleName ( ) ) ; } return testResources ; }


Input: @param factory the factory for creating conclusions [CODESPLIT] public ForwardLink getConclusion ( ClassConclusion . Factory factory ) { return factory . getForwardLink ( getDestination ( ) , existential_ . getProperty ( ) , IndexedObjectSomeValuesFrom . Helper . getTarget ( existential_ ) ) ; }


Input: Process the given input concurrently using the provided input processor . If the process has been interrupted this method can be called again to continue the computation . [CODESPLIT] public void process ( ) { if ( ! start ( ) ) { String message = "Could not start workers required for reasoner computation!" ; LOGGER_ . error ( message ) ; throw new ElkRuntimeException ( message ) ; } try { // submit the leftover from the previous run if ( nextInput != null ) { if ( ! processNextInput ( ) ) return ; } // repeatedly submit the next inputs from todo while ( todo . hasNext ( ) ) { nextInput = todo . next ( ) ; if ( ! processNextInput ( ) ) return ; } finish ( ) ; } catch ( InterruptedException e ) { // restore interrupt status Thread . currentThread ( ) . interrupt ( ) ; throw new ElkRuntimeException ( "Reasoner computation interrupted externally!" ) ; } }


Input: Combines the provided partial incompleteness monitors into the top - level monitor for reasoning tasks . [CODESPLIT] public IncompletenessMonitor getReasonerIncompletenessMonitor ( final IncompletenessMonitor ... additionalMonitors ) { final List < IncompletenessMonitor > monitors = new ArrayList < IncompletenessMonitor > ( additionalMonitors . length + 1 ) ; monitors . add ( getIncompletenessDueToStatedAxiomsMonitor ( ) ) ; monitors . addAll ( Arrays . asList ( additionalMonitors ) ) ; return new DelegatingIncompletenessMonitor ( monitors ) { @ Override public boolean logNewIncompletenessReasons ( final Logger logger ) { final boolean result = super . logNewIncompletenessReasons ( logger ) ; if ( result ) { LoggerWrap . log ( logger , LogLevel . WARN , MARKER_ , "Reasoning may be incomplete! See log level INFO for more details." ) ; } return result ; } } ; }


Input: TODO : parentheses and precedence of symbols [CODESPLIT] @ Override public String visit ( IndexedClass element ) { ElkClass entity = element . getElkEntity ( ) ; if ( entity . getIri ( ) . equals ( PredefinedElkIris . OWL_THING ) ) { return "⊤";  } // else if ( entity . getIri ( ) . equals ( PredefinedElkIris . OWL_NOTHING ) ) { return "⊥";  } // else return entity . toString ( ) ; }


Input: / * read - write methods [CODESPLIT] @ Override public void add ( CachedIndexedObject < ? > input ) { if ( ! incrementalMode ) { super . add ( input ) ; return ; } // else incrementalMode LOGGER_ . trace ( "{}: to add" , input ) ; if ( input instanceof IndexedEntity ) ( ( IndexedEntity ) input ) . accept ( entityInsertionListener_ ) ; if ( todoDeletions_ . remove ( input ) ) return ; // else super . add ( input ) ; }


Input: Removes the deleted rules from this { [CODESPLIT] public void clearDeletedRules ( ) { for ( CachedIndexedObject < ? > deletion : todoDeletions_ ) { LOGGER_ . trace ( "{}: comitting removal" , deletion ) ; super . remove ( deletion ) ; } initDeletions ( ) ; }


Input: Commits the added rules to the main index and removes them from this { [CODESPLIT] public void commitAddedRules ( ) { // commit changes in the context initialization rules ChainableContextInitRule nextContextInitRule ; Chain < ChainableContextInitRule > contextInitRuleChain ; nextContextInitRule = addedContextInitRules_ ; contextInitRuleChain = getContextInitRuleChain ( ) ; while ( nextContextInitRule != null ) { nextContextInitRule . addTo ( contextInitRuleChain ) ; nextContextInitRule = nextContextInitRule . next ( ) ; } // commit changes in rules for IndexedClassExpression ChainableSubsumerRule nextClassExpressionRule ; Chain < ChainableSubsumerRule > classExpressionRuleChain ; for ( ModifiableIndexedClassExpression target : addedContextRuleHeadByClassExpressions_ . keySet ( ) ) { LOGGER_ . trace ( "{}: committing context rule additions" , target ) ; nextClassExpressionRule = addedContextRuleHeadByClassExpressions_ . get ( target ) ; classExpressionRuleChain = target . getCompositionRuleChain ( ) ; while ( nextClassExpressionRule != null ) { nextClassExpressionRule . addTo ( classExpressionRuleChain ) ; nextClassExpressionRule = nextClassExpressionRule . next ( ) ; } } for ( ModifiableIndexedClass target : addedDefinitions_ . keySet ( ) ) { ModifiableIndexedClassExpression definition = addedDefinitions_ . get ( target ) ; ElkAxiom reason = addedDefinitionReasons_ . get ( target ) ; LOGGER_ . trace ( "{}: committing definition addition {}" , target , definition ) ; if ( ! target . setDefinition ( definition , reason ) ) throw new ElkUnexpectedIndexingException ( target ) ; } initAdditions ( ) ; }


Input: Sets the incremental mode for this { @code DifferentialIndex } . [CODESPLIT] public void setIncrementalMode ( boolean incremental ) { if ( this . incrementalMode == incremental ) // already set return ; LOGGER_ . trace ( "set incremental mode: " + incremental ) ; this . incrementalMode = incremental ; if ( ! incremental ) { clearDeletedRules ( ) ; commitAddedRules ( ) ; initClassChanges ( ) ; initIndividualChanges ( ) ; } }


Input: Add { @link ObjectIntersectionFromFirstConjunctRule } s for the given { @link ModifiableIndexedObjectIntersectionOf } in the given { @link ModifiableOntologyIndex } [CODESPLIT] public static boolean addRulesFor ( ModifiableIndexedObjectIntersectionOf conjunction , ModifiableOntologyIndex index ) { return index . add ( conjunction . getSecondConjunct ( ) , new ObjectIntersectionFromFirstConjunctRule ( conjunction . getFirstConjunct ( ) , conjunction ) ) ; }


Input: Removes { @link ObjectIntersectionFromFirstConjunctRule } s for the given { @link ModifiableIndexedObjectIntersectionOf } in the given { @link ModifiableOntologyIndex } [CODESPLIT] public static boolean removeRulesFor ( ModifiableIndexedObjectIntersectionOf conjunction , ModifiableOntologyIndex index ) { return index . remove ( conjunction . getSecondConjunct ( ) , new ObjectIntersectionFromFirstConjunctRule ( conjunction . getFirstConjunct ( ) , conjunction ) ) ; }


Input: TODO : create a generic method for this operation ( used in other places ) [CODESPLIT] private int indexOf ( IndexedPropertyChain subChain , ElkAxiom reason ) { for ( int i = 0 ; i < toldSubChains_ . size ( ) ; i ++ ) { if ( toldSubChains_ . get ( i ) . equals ( subChain ) && toldSubChainsReasons_ . get ( i ) . equals ( reason ) ) return i ; } // else not found return - 1 ; }


Input: @param factory the factory for creating conclusions [CODESPLIT] public final DisjointSubsumer getConclusion ( DisjointSubsumer . Factory factory ) { return factory . getDisjointSubsumer ( getDestination ( ) , getDisjointExpressions ( ) , getPosition ( ) ) ; }


Input: One - parameter public non - static methods called visit and declared in this class enumerate subclasses of { @link ElkAxiom } ( parameter ) for which entailment queries are supported . This method returns { @code true } iff the subclass of { @link ElkAxiom } specified as the parameter is a parameter type of some of these methods e . g . whether entailment query of such an { @link ElkAxiom } is supported . [CODESPLIT] public static boolean isEntailmentCheckingSupported ( final Class < ? extends ElkAxiom > axiomClass ) { for ( final Method declaredMethod : EntailmentQueryConverter . class . getDeclaredMethods ( ) ) { final int mod = declaredMethod . getModifiers ( ) ; final Class < ? > [ ] parameterTypes = declaredMethod . getParameterTypes ( ) ; if ( "visit" . equals ( declaredMethod . getName ( ) ) && Modifier . isPublic ( mod ) && ! Modifier . isStatic ( mod ) && parameterTypes . length == 1 && parameterTypes [ 0 ] . isAssignableFrom ( axiomClass ) ) { // There is a declared visit method that accepts axiomClass return true ; } } return false ; }


Input: Convenience method for printing a { @link Taxonomy } to a file at the given location . [CODESPLIT] public static void dumpTaxomomyToFile ( final Taxonomy < ? extends ElkEntity > taxonomy , final String fileName , final boolean addHash ) throws IOException { final FileWriter fstream = new FileWriter ( fileName ) ; final BufferedWriter writer = new BufferedWriter ( fstream ) ; try { dumpTaxomomy ( taxonomy , writer , addHash ) ; } finally { writer . close ( ) ; } }


Input: Print the contents of the given { @link Taxonomy } to the specified Writer . Expressions are ordered for generating the output ensuring that the output is deterministic . [CODESPLIT] public static void dumpTaxomomy ( final Taxonomy < ? extends ElkEntity > taxonomy , final Writer writer , final boolean addHash ) throws IOException { writer . append ( "Ontology(\n" ) ; processTaxomomy ( taxonomy , writer ) ; writer . append ( ")\n" ) ; if ( addHash ) { writer . append ( "\n# Hash code: " + getHashString ( taxonomy ) + "\n" ) ; } writer . flush ( ) ; }


Input: Convenience method for printing an { @link InstanceTaxonomy } to a file at the given location . [CODESPLIT] public static void dumpInstanceTaxomomyToFile ( final InstanceTaxonomy < ? extends ElkEntity , ? extends ElkEntity > taxonomy , final String fileName , final boolean addHash ) throws IOException { final FileWriter fstream = new FileWriter ( fileName ) ; final BufferedWriter writer = new BufferedWriter ( fstream ) ; try { dumpInstanceTaxomomy ( taxonomy , writer , addHash ) ; } finally { writer . close ( ) ; } }


Input: Print the contents of the given { @link InstanceTaxonomy } to the specified Writer . Expressions are ordered for generating the output ensuring that the output is deterministic . [CODESPLIT] public static void dumpInstanceTaxomomy ( final InstanceTaxonomy < ? extends ElkEntity , ? extends ElkEntity > taxonomy , final Writer writer , final boolean addHash ) throws IOException { writer . write ( "Ontology(\n" ) ; processInstanceTaxomomy ( taxonomy , writer ) ; writer . write ( ")\n" ) ; if ( addHash ) { writer . write ( "\n# Hash code: " + getInstanceHashString ( taxonomy ) + "\n" ) ; } writer . flush ( ) ; }


Input: Get a has string for the given { @link Taxonomy } . Besides possible hash collisions ( which have very low probability ) the hash string is the same for two inputs if and only if the inputs describe the same taxonomy . So it can be used to compare classification results . [CODESPLIT] public static String getHashString ( Taxonomy < ? extends ElkEntity > taxonomy ) { return Integer . toHexString ( TaxonomyHasher . hash ( taxonomy ) ) ; }


Input: Process a taxonomy and write a normalized serialization . [CODESPLIT] protected static < T extends ElkEntity > void processTaxomomy ( final Taxonomy < T > taxonomy , final Appendable writer ) throws IOException { final ElkObject . Factory factory = new ElkObjectEntityRecyclingFactory ( ) ; // Declarations. final List < T > members = new ArrayList < T > ( taxonomy . getNodes ( ) . size ( ) * 2 ) ; for ( final TaxonomyNode < T > node : taxonomy . getNodes ( ) ) { for ( final T member : node ) { // TODO: this should check whether IRIs are predefined! if ( ! member . getIri ( ) . equals ( taxonomy . getTopNode ( ) . getCanonicalMember ( ) . getIri ( ) ) && ! member . getIri ( ) . equals ( taxonomy . getBottomNode ( ) . getCanonicalMember ( ) . getIri ( ) ) ) { members . add ( member ) ; } } } Collections . sort ( members , taxonomy . getKeyProvider ( ) . getComparator ( ) ) ; printDeclarations ( members , factory , writer ) ; // Relations. final TreeSet < T > canonicalMembers = new TreeSet < T > ( taxonomy . getKeyProvider ( ) . getComparator ( ) ) ; for ( final TaxonomyNode < T > node : taxonomy . getNodes ( ) ) { canonicalMembers . add ( node . getCanonicalMember ( ) ) ; } for ( final T canonicalMember : canonicalMembers ) { final TaxonomyNode < T > node = taxonomy . getNode ( canonicalMember ) ; final ArrayList < T > orderedEquivalentMembers = new ArrayList < T > ( node . size ( ) ) ; for ( final T member : node ) { orderedEquivalentMembers . add ( member ) ; } Collections . sort ( orderedEquivalentMembers , taxonomy . getKeyProvider ( ) . getComparator ( ) ) ; final TreeSet < T > orderedSuperMembers = new TreeSet < T > ( taxonomy . getKeyProvider ( ) . getComparator ( ) ) ; for ( final TaxonomyNode < T > superNode : node . getDirectSuperNodes ( ) ) { orderedSuperMembers . add ( superNode . getCanonicalMember ( ) ) ; } printMemberAxioms ( canonicalMember , orderedEquivalentMembers , orderedSuperMembers , taxonomy , factory , writer ) ; } }


Input: Process axioms related to one member of { [CODESPLIT] protected static < T extends ElkEntity , I extends ElkEntity > void printMemberAxioms ( final I member , final List < I > equivalentMembers , final SortedSet < T > directSuperMembers , final Taxonomy < T > taxonomy , final ElkObject . Factory factory , final Appendable writer ) throws IOException { if ( equivalentMembers . size ( ) > 1 ) { final ElkAxiom axiom = member . accept ( getEquivalentAxiomProvider ( equivalentMembers , factory ) ) ; OwlFunctionalStylePrinter . append ( writer , axiom , true ) ; writer . append ( ' ' ) ; } // TODO: this should exclude implicit axioms as owl:Thing ⊑ owl:Nothing if ( ! member . equals ( taxonomy . getBottomNode ( ) . getCanonicalMember ( ) ) ) { for ( final T superMember : directSuperMembers ) { if ( ! superMember . equals ( taxonomy . getTopNode ( ) . getCanonicalMember ( ) ) ) { final ElkAxiom axiom = member . accept ( getSubAxiomProvider ( superMember , factory ) ) ; OwlFunctionalStylePrinter . append ( writer , axiom , true ) ; writer . append ( ' ' ) ; } } } }


Input: Records that the given { @link ClassInference } has the given premise { @code ClassConclusion } that is not a conclusion of any inference in { @link #output_ } that do not use the conclusion of this { @link ClassInference } as one of the premises [CODESPLIT] private void block ( ClassInference inference , ClassConclusion conclusion ) { List < ClassInference > blockedForConclusion = blocked_ . get ( conclusion ) ; if ( blockedForConclusion == null ) { blockedForConclusion = new ArrayList < ClassInference > ( ) ; blocked_ . put ( conclusion , blockedForConclusion ) ; } blockedForConclusion . add ( inference ) ; }


Input: Compute the hash code of a taxonomy . [CODESPLIT] public static int hash ( InstanceTaxonomy < ? extends ElkEntity , ? extends ElkEntity > taxonomy ) { int typeHash = HashGenerator . combineMultisetHash ( true , taxonomy . getNodes ( ) , TypeNodeHasher . INSTANCE ) ; int instanceHash = HashGenerator . combineMultisetHash ( true , taxonomy . getInstanceNodes ( ) , InstanceNodeHasher . INSTANCE ) ; return HashGenerator . combineListHash ( typeHash , instanceHash ) ; }


Input: Produces propagations of { @link IndexedObjectSomeValuesFrom } over the given { @link IndexedObjectProperty } in the given { @link Context } [CODESPLIT] void applyForProperty ( IndexedObjectProperty property , ContextPremises premises , ClassInferenceProducer producer ) { for ( IndexedObjectSomeValuesFrom e : negExistentials_ ) { if ( e . getProperty ( ) . getSaturated ( ) . getSubPropertyChains ( ) . contains ( property ) ) { producer . produce ( new PropagationGenerated ( premises . getRoot ( ) , property , e ) ) ; } } }


Input: Submitting a new input for processing . Submitted input jobs are first buffered and then concurrently processed by workers . If the buffer is full the method blocks until new space is available . [CODESPLIT] public synchronized boolean submit ( I input ) throws InterruptedException { if ( termination || isInterrupted ( ) ) return false ; buffer_ . put ( input ) ; return true ; }


Input: Printing an ELK Object through an appender . [CODESPLIT] public static void append ( Appendable appender , ElkObject elkObject ) throws IOException { append ( appender , elkObject , false ) ; }


Input: Clear all derived information for this { [CODESPLIT] public void clear ( ) { derivedSubProperties = null ; derivedSubProperyChains = null ; derivedSubPropertiesComputed = false ; derivedRanges = null ; derivedRangesComputed = false ; leftSubComposableSubPropertiesByRightProperties = null ; leftSubComposableSubPropertiesByRightPropertiesComputed = false ; nonRedundantCompositionsByLeftSubProperty = null ; redundantCompositionsByLeftSubProperty = null ; nonRedundantCompositionsByRightSubProperty = null ; redundantCompositionsByRightSubProperty = null ; }


Input: Prints differences with other { @link SaturatedPropertyChain } [CODESPLIT] public void dumpDiff ( SaturatedPropertyChain other , Writer writer ) throws IOException { // comparing roots if ( this . root != other . root ) writer . append ( "this root: " + root + "; other root: " + other . root + "\n" ) ; // comparing derived sub-properties Operations . dumpDiff ( this . getSubPropertyChains ( ) , other . getSubPropertyChains ( ) , writer , root + ": this sub-property not in other: " ) ; Operations . dumpDiff ( other . getSubPropertyChains ( ) , this . getSubPropertyChains ( ) , writer , root + ": other sub-property not in this: " ) ; // comparing derived compositions Operations . dumpDiff ( this . getNonRedundantCompositionsByLeftSubProperty ( ) , other . getNonRedundantCompositionsByLeftSubProperty ( ) , writer , root + ": this non-redundant left composition not in other: " ) ; Operations . dumpDiff ( this . getRedundantCompositionsByLeftSubProperty ( ) , other . getRedundantCompositionsByLeftSubProperty ( ) , writer , root + ": this redundant left composition not in other: " ) ; Operations . dumpDiff ( other . getNonRedundantCompositionsByLeftSubProperty ( ) , this . getNonRedundantCompositionsByLeftSubProperty ( ) , writer , root + ": other non-redundant left composition not in this: " ) ; Operations . dumpDiff ( other . getRedundantCompositionsByLeftSubProperty ( ) , this . getRedundantCompositionsByLeftSubProperty ( ) , writer , root + ": other redundant left composition not in this: " ) ; Operations . dumpDiff ( this . getNonRedundantCompositionsByRightSubProperty ( ) , other . getNonRedundantCompositionsByRightSubProperty ( ) , writer , root + ": this non-redundant right composition not in other: " ) ; Operations . dumpDiff ( this . getRedundantCompositionsByRightSubProperty ( ) , other . getRedundantCompositionsByRightSubProperty ( ) , writer , root + ": this redundant right composition not in other: " ) ; Operations . dumpDiff ( other . getNonRedundantCompositionsByRightSubProperty ( ) , this . getNonRedundantCompositionsByRightSubProperty ( ) , writer , root + ": other non-redundant right composition not in this: " ) ; Operations . dumpDiff ( other . getRedundantCompositionsByRightSubProperty ( ) , this . getRedundantCompositionsByRightSubProperty ( ) , writer , root + ": other redundant right composition not in this: " ) ; }


Input: Increasing the capacity of the table [CODESPLIT] private void enlarge ( ) { int oldCapacity = data . length ; if ( oldCapacity == LinearProbing . MAXIMUM_CAPACITY ) throw new IllegalArgumentException ( "The set cannot grow beyond the capacity: " + LinearProbing . MAXIMUM_CAPACITY ) ; E [ ] oldData = data ; int newCapacity = oldCapacity << 1 ; @ SuppressWarnings ( "unchecked" ) E [ ] newData = ( E [ ] ) new Object [ newCapacity ] ; for ( int i = 0 ; i < oldCapacity ; i ++ ) { E e = oldData [ i ] ; if ( e != null ) LinearProbing . add ( newData , e ) ; } this . data = newData ; }


Input: Decreasing the capacity of the table [CODESPLIT] private void shrink ( ) { int oldCapacity = data . length ; if ( oldCapacity == 1 ) return ; E [ ] oldData = data ; int newCapacity = oldCapacity >> 1 ; @ SuppressWarnings ( "unchecked" ) E [ ] newData = ( E [ ] ) new Object [ newCapacity ] ; for ( int i = 0 ; i < oldCapacity ; i ++ ) { E e = oldData [ i ] ; if ( e != null ) LinearProbing . add ( newData , e ) ; } this . data = newData ; }


Input: / * Checks that all System properties are set . We use System properties ( other than cmd args ) because they re easier to pass parameters into maven tests ( via Surefire or Failsafe plugins ) [CODESPLIT] public static Map < String , String > getSystemProperties ( String ... names ) { Map < String , String > propMap = new HashMap < String , String > ( ) ; for ( String name : names ) { checkIfSet ( name , propMap ) ; } return propMap ; }


Input: / * A macro method reads system properties instantiates the task and runs it [CODESPLIT] public static void runTask ( ) throws Exception { Map < String , String > propMap = BenchmarkUtils . getSystemProperties ( new String [ ] { Constants . TASK_CLASS_NAME , Constants . WARM_UPS , Constants . RUNS , Constants . TASK_PARAMS } ) ; // First, need to instantiate the task Task task = TaskFactory . createTask ( propMap . get ( Constants . TASK_CLASS_NAME ) , BenchmarkUtils . getCommaSeparatedParameter ( Constants . TASK_PARAMS ) ) ; TaskRunner runner = new TaskRunner ( Integer . valueOf ( propMap . get ( Constants . WARM_UPS ) ) , Integer . valueOf ( propMap . get ( Constants . RUNS ) ) ) ; runner . run ( task ) ; }


Input: / * A macro method reads system properties instantiates the task collection and runs it [CODESPLIT] public static void runTaskCollection ( ) throws Exception { Map < String , String > propMap = BenchmarkUtils . getSystemProperties ( new String [ ] { Constants . TASK_CLASS_NAME , Constants . WARM_UPS , Constants . RUNS , Constants . TASK_PARAMS } ) ; TaskCollection collection = TaskFactory . createTaskCollection ( propMap . get ( Constants . TASK_CLASS_NAME ) , BenchmarkUtils . getCommaSeparatedParameter ( Constants . TASK_PARAMS ) ) ; RepeatEachTaskRunner runner = new RepeatEachTaskRunner ( Integer . valueOf ( propMap . get ( Constants . WARM_UPS ) ) , Integer . valueOf ( propMap . get ( Constants . RUNS ) ) ) ; runner . run ( collection ) ; }


Input: TODO need a better name [CODESPLIT] public static void runTaskCollection2 ( String taskClass , int warmups , int runs , String [ ] params ) throws Exception { VisitorTaskCollection collection = TaskFactory . createTaskCollection2 ( taskClass , params ) ; RunAllOnceThenRepeatRunner runner = new RunAllOnceThenRepeatRunner ( warmups , runs ) ; try { runner . run ( collection ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw e ; } }


Input: @param factory the factory for creating conclusions [CODESPLIT] public final ForwardLink getConclusion ( ForwardLink . Factory factory ) { return factory . getForwardLink ( getDestination ( ) , getChain ( ) , getTarget ( ) ) ; }


Input: } [CODESPLIT] @ Override public final < O > O accept ( TracingInference . Visitor < O > visitor ) { return accept ( ( ObjectPropertyInference . Visitor < O > ) visitor ) ; }


Input: One - parameter public non - static methods called convert and declared in this class specify mapping between { @link OWLObject } subclasses ( parameter ) and { @link ElkObject } subclasses ( return type ) . This method returns a subclass of { @link ElkObject } to which the subclass of { @link OWLObject } specified as the parameter is mapped or { @code null } if it is not mapped . [CODESPLIT] public static Class < ? extends ElkObject > convertType ( final Class < ? > owlClass ) { if ( ! OWLObject . class . isAssignableFrom ( owlClass ) ) { return null ; } for ( final Method declaredMethod : OwlConverter . class . getDeclaredMethods ( ) ) { final int mod = declaredMethod . getModifiers ( ) ; final Class < ? > [ ] parameterTypes = declaredMethod . getParameterTypes ( ) ; final Class < ? > returnType = declaredMethod . getReturnType ( ) ; if ( "convert" . equals ( declaredMethod . getName ( ) ) && Modifier . isPublic ( mod ) && ! Modifier . isStatic ( mod ) && parameterTypes . length == 1 && parameterTypes [ 0 ] . equals ( owlClass ) && ElkObject . class . isAssignableFrom ( returnType ) ) { return returnType . asSubclass ( ElkObject . class ) ; } } return null ; }


Input: @param visitor @return A { @link RuleVisitor } that delegates the calls to the provided { @link RuleVisitor } when for the { @link Rule } which accepts this visitor { @link Rule#isTracingRule () } returns { @code true } . Otherwise the { @link RuleVisitor } returns { @code null } . [CODESPLIT] public static < O > RuleVisitor < O > getTracingVisitor ( RuleVisitor < O > visitor ) { return new ConditionalRuleVisitor < O > ( visitor , LOCALITY_CHECKER_ ) ; }


Input: @param visitor the { @link SubsumerDecompositionVisitor } used to execute the methods @param timer the { @link RuleApplicationTimer } used to mesure the time spent within the methods [CODESPLIT] public static < O > RuleVisitor < O > getTimedVisitor ( RuleVisitor < O > visitor , RuleApplicationTimer timer ) { return new RuleApplicationTimerVisitor < O > ( visitor , timer ) ; }


Input: Process all pending { @link ClassInference } s of the given { @link Context } [CODESPLIT] void process ( Context context ) { activeContext_ . set ( context ) ; // at this point workerLocalTodo_ must be empty workerLocalTodo_ . setActiveRoot ( context . getRoot ( ) ) ; for ( ; ; ) { ClassInference inference = workerLocalTodo_ . poll ( ) ; if ( inference == null ) { inference = context . takeToDo ( ) ; if ( inference == null ) return ; } LOGGER_ . trace ( "{}: processing inference {}" , context , inference ) ; inference . accept ( inferenceProcessor_ ) ; } }


Input: If the specified query was added to the index this method marks it as computed . Does <strong > not< / strong > modify the cached query results . [CODESPLIT] private QueryState markComputed ( final IndexedClassExpression queryClass ) { final QueryState state = indexed_ . get ( queryClass ) ; if ( state == null || state . isComputed ) { return null ; } state . isComputed = true ; LOGGER_ . trace ( "query computed {}" , queryClass ) ; return state ; }


Input: If the specified query was added to the index this method marks it as not - computed and deletes the query results . [CODESPLIT] private QueryState markNotComputed ( final IndexedClassExpression queryClass ) { final QueryState state = indexed_ . get ( queryClass ) ; if ( state == null || ! state . isComputed ) { return null ; } state . isComputed = false ; if ( state . node != null ) { removeAllRelated ( queryClass , state . node ) ; state . node = null ; } return state ; }


Input: Registers the supplied class expression for querying . If the expression has already been registered returns { @code false } . Otherwise if this state did not keep track of the expression yet returns { @code true } . If all necessary stages are run after doing this the result retrieval methods e . g . { @link #isSatisfiable ( ElkClassExpression ) } will not throw { @link ElkQueryException } . [CODESPLIT] boolean registerQuery ( final ElkClassExpression classExpression ) { LOGGER_ . trace ( "class expression query registered {}" , classExpression ) ; lastQueries_ . clear ( ) ; queriedEvictor_ . add ( classExpression ) ; lastQueries_ . add ( classExpression ) ; QueryState state = queried_ . get ( classExpression ) ; if ( state != null ) { return false ; } // Create query state. state = new QueryState ( ) ; queried_ . put ( classExpression , state ) ; toLoad_ . offer ( classExpression ) ; return true ; }


Input: Checks whether the supplied class expression is satisfiable if the result was already computed . If the class expression was not registered by { @link #registerQuery ( ElkClassExpression ) } or the appropriate stage was not completed yet throws { @link ElkQueryException } . [CODESPLIT] boolean isSatisfiable ( final ElkClassExpression classExpression ) throws ElkQueryException { final QueryState state = checkComputed ( classExpression ) ; return state . node != null ; }


Input: Returns { @link Node } containing all { @link ElkClass } es equivalent to the supplied class expression if it is satisfiable . Returns <code > null< / code > otherwise . If the class expression was not registered by { @link #registerQuery ( ElkClassExpression ) } or the appropriate stage was not completed yet throws { @link ElkQueryException } . [CODESPLIT] Node < ElkClass > getEquivalentClasses ( final ElkClassExpression classExpression ) throws ElkQueryException { final QueryState state = checkComputed ( classExpression ) ; return state . node ; }


Input: Returns set of { @link Node } s containing all { @link ElkClass } es that are direct strict super - classes of the supplied class expression if it is satisfiable . Returns <code > null< / code > otherwise . If the class expression was not registered by { @link #registerQuery ( ElkClassExpression ) } or the appropriate stage was not completed yet throws { @link ElkQueryException } . [CODESPLIT] Set < ? extends Node < ElkClass > > getDirectSuperClasses ( final ElkClassExpression classExpression ) throws ElkQueryException { final QueryState state = checkComputed ( classExpression ) ; if ( state . node == null ) { return null ; } else { return state . node . getDirectSuperNodes ( ) ; } }


Input:
Returns set of { @link Node } s containing all { @link ElkClass } es that are direct strict sub - classes of the supplied class expression if it is satisfiable . Returns <code > null< / code > otherwise . If the class expression was not registered by { @link #registerQuery ( ElkClassExpression ) } or the appropriate stage was not completed yet throws { @link ElkQueryException } . [CODESPLIT] Set < ? extends Node < ElkClass > > getDirectSubClasses ( final ElkClassExpression classExpression , final Taxonomy < ElkClass > taxonomy ) throws ElkQueryException { final QueryState state = checkComputed ( classExpression ) ; if ( state . node == null ) { return null ; } // else final Iterator < ElkClass > iter = state . node . iterator ( ) ; if ( iter . hasNext ( ) ) { final ElkClass cls = iter . next ( ) ; return taxonomy . getNode ( cls ) . getDirectSubNodes ( ) ; } /*
		 * Else, if classExpression is not equivalent to any atomic class,
		 * direct atomic sub-classes of classExpression are atomic classes that
		 * have classExpression among their subsumers, but no other of their
		 * strict subsumers have classExpression among its subsumers.
		 */ final Collection < ? extends IndexedClass > allClasses = saturationState_ . getOntologyIndex ( ) . getClasses ( ) ; final Set < IndexedClass > strictSubclasses = new ArrayHashSet < IndexedClass > ( allClasses . size ( ) ) ; for ( final IndexedClass ic : allClasses ) { final Set < IndexedClassExpression > subsumers = ic . getContext ( ) . getComposedSubsumers ( ) ; if ( subsumers . contains ( state . indexed ) && state . indexed . getContext ( ) . getComposedSubsumers ( ) . size ( ) != subsumers . size ( ) ) { // is subclass, but not equivalent strictSubclasses . add ( ic ) ; } } final Set < TaxonomyNode < ElkClass > > result = new ArrayHashSet < TaxonomyNode < ElkClass > > ( ) ; for ( final IndexedClass strictSubclass : strictSubclasses ) { /*
			 * If some strict superclass of strictSubclass is a strict subclass
			 * of classExpression, strictSubclass is not direct.
			 *
			 * It is sufficient to check only direct superclasses of
			 * strictSubclass.
			 */ boolean isDirect = true ; for ( final TaxonomyNode < ElkClass > superNode : taxonomy . getNode ( strictSubclass . getElkEntity ( ) ) . getDirectSuperNodes ( ) ) { final IndexedClassExpression superClass = superNode . getCanonicalMember ( ) . accept ( resolvingExpressionConverter_ ) ; if ( strictSubclasses . contains ( superClass ) ) { isDirect = false ; break ; } } if ( isDirect ) { result . add ( taxonomy . getNode ( strictSubclass . getElkEntity ( ) ) ) ; } } if ( result . isEmpty ( ) ) { /*
			 * No indexed class has classExpression among its subsumers and
			 * classExpression is not equivalent to any atomic class, so the
			 * only subclass of classExpression is Nothing and it is direct.
			 */ result . add ( taxonomy . getBottomNode ( ) ) ; } return Collections . unmodifiableSet ( result ) ; }


Input:
Returns set of { @link Node } s containing all { @link ElkNamedIndividual } s that are direct instances of the supplied class expression if it is satisfiable . Returns <code > null< / code > otherwise . If the class expression was not registered by { @link #registerQuery ( ElkClassExpression ) } or the appropriate stage was not completed yet throws { @link ElkQueryException } . [CODESPLIT] Set < ? extends Node < ElkNamedIndividual > > getDirectInstances ( final ElkClassExpression classExpression , final InstanceTaxonomy < ElkClass , ElkNamedIndividual > taxonomy ) throws ElkQueryException { final QueryState state = checkComputed ( classExpression ) ; if ( state . node == null ) { return null ; } // else final Iterator < ElkClass > iter = state . node . iterator ( ) ; if ( iter . hasNext ( ) ) { final ElkClass cls = iter . next ( ) ; return taxonomy . getNode ( cls ) . getDirectInstanceNodes ( ) ; } /*
		 * Else, if classExpression is not equivalent to any atomic class,
		 * direct instances of classExpression are instances that have
		 * classExpression among their subsumers, but no other of their strict
		 * subsumers have classExpression among its subsumers.
		 */ final Collection < ? extends IndexedIndividual > allIndividuals = saturationState_ . getOntologyIndex ( ) . getIndividuals ( ) ; final Set < IndexedIndividual > instances = new ArrayHashSet < IndexedIndividual > ( allIndividuals . size ( ) ) ; for ( final IndexedIndividual ii : allIndividuals ) { final Set < IndexedClassExpression > subsumers = ii . getContext ( ) . getComposedSubsumers ( ) ; if ( subsumers . contains ( state . indexed ) ) { instances . add ( ii ) ; } } final Set < InstanceNode < ElkClass , ElkNamedIndividual > > result = new ArrayHashSet < InstanceNode < ElkClass , ElkNamedIndividual > > ( ) ; for ( final IndexedIndividual instance : instances ) { /*
			 * If some type of instance is a strict subclass of classExpression,
			 * instance is not direct.
			 *
			 * It is sufficient to check only direct types of instance.
			 */ boolean isDirect = true ; for ( final TypeNode < ElkClass , ElkNamedIndividual > typeNode : taxonomy . getInstanceNode ( instance . getElkEntity ( ) ) . getDirectTypeNodes ( ) ) { final IndexedClassExpression type = typeNode . getCanonicalMember ( ) . accept ( resolvingExpressionConverter_ ) ; final Set < IndexedClassExpression > subsumers = type . getContext ( ) . getComposedSubsumers ( ) ; if ( subsumers . contains ( state . indexed ) && state . indexed . getContext ( ) . getComposedSubsumers ( ) . size ( ) != subsumers . size ( ) ) { // is subclass, but not equivalent isDirect = false ; break ; } } if ( isDirect ) { result . add ( taxonomy . getInstanceNode ( instance . getElkEntity ( ) ) ) ; } } return Collections . unmodifiableSet ( result ) ; }


Input: logging is switched off [CODESPLIT] @ Override protected Boolean defaultVisit ( ClassConclusion conclusion ) { Context context = get ( ) ; boolean result = context . addConclusion ( conclusion ) ; if ( LOGGER_ . isTraceEnabled ( ) ) { LOGGER_ . trace ( "{}: inserting {}: {}" , context , conclusion , result ? "success" : "failure" ) ; } return result ; }


Input: / * can return a smaller subset than requested because one axiom can be randomly picked more than once [CODESPLIT] protected Set < ElkAxiom > getRandomSubset ( List < ElkAxiom > axioms , Random rnd ) { int size = axiomsToChange > 0 ? axiomsToChange : Math . max ( 1 , axioms . size ( ) / 100 ) ; Set < ElkAxiom > subset = new ArrayHashSet < ElkAxiom > ( size ) ; if ( size >= axioms . size ( ) ) { subset . addAll ( axioms ) ; } else { for ( int i = 0 ; i < size ; i ++ ) { ElkAxiom axiom = axioms . get ( rnd . nextInt ( size ) ) ; subset . add ( axiom ) ; } } return subset ; }


Input: Compute the hash code of a taxonomy . [CODESPLIT] public static int hash ( Taxonomy < ? extends ElkEntity > taxonomy ) { return HashGenerator . combineMultisetHash ( true , taxonomy . getNodes ( ) , TaxonomyNodeHasher . INSTANCE ) ; }


Input: Add a direct super - class node . This method is not thread safe . [CODESPLIT] @ Override public synchronized void addDirectTypeNode ( final UTN typeNode ) { LOGGER_ . trace ( "{}: new direct type-node {}" , this , typeNode ) ; directTypeNodes_ . add ( typeNode ) ; }


Input: Creates a new primary { @link SaturationStateWriter } for the { @link SaturationState } to be used by an engine of this { @link RuleApplicationFactory } . This { @link SaturationStateWriter } can be further extended and optimized . [CODESPLIT] SaturationStateWriter < ? extends C > getBaseWriter ( ContextCreationListener creationListener , ContextModificationListener modificationListener ) { // by default the writer can create new contexts return saturationState_ . getContextCreatingWriter ( creationListener , modificationListener ) ; }


Input: some methods for checking correctness of arguments [CODESPLIT] protected static void checkChainMatch ( final ElkSubObjectPropertyExpression fullChain , final int startPos ) { // verifies that start position exists in full chain fullChain . accept ( new ElkSubObjectPropertyExpressionVisitor < Void > ( ) { void fail ( ) { throw new IllegalArgumentException ( fullChain + ", " + startPos ) ; } Void defaultVisit ( ElkObjectPropertyExpression expression ) { if ( startPos != 0 ) { fail ( ) ; } return null ; } @ Override public Void visit ( ElkObjectPropertyChain expression ) { if ( startPos < 0 || startPos >= expression . getObjectPropertyExpressions ( ) . size ( ) ) fail ( ) ; return null ; } @ Override public Void visit ( ElkObjectInverseOf expression ) { return defaultVisit ( expression ) ; } @ Override public Void visit ( ElkObjectProperty expression ) { return defaultVisit ( expression ) ; } } ) ; }


Input: Concatenates several { @link Iterable } s into one [CODESPLIT] public static < T > Iterable < T > concat ( final Iterable < ? extends Iterable < ? extends T > > inputs ) { assert inputs != null ; return new Iterable < T > ( ) { @ Override public Iterator < T > iterator ( ) { return new Iterator < T > ( ) { Iterator < ? extends Iterable < ? extends T > > outer = inputs . iterator ( ) ; Iterator < ? extends T > inner ; boolean hasNext = advance ( ) ; @ Override public boolean hasNext ( ) { return hasNext ; } @ Override public T next ( ) { if ( hasNext ) { T result = inner . next ( ) ; hasNext = advance ( ) ; return result ; } throw new NoSuchElementException ( ) ; } @ Override public void remove ( ) { throw new UnsupportedOperationException ( ) ; } boolean advance ( ) { while ( true ) { if ( inner != null && inner . hasNext ( ) ) return true ; if ( outer . hasNext ( ) ) inner = outer . next ( ) . iterator ( ) ; else return false ; } } } ; } } ; }


Input: Splits the input { @link Iterable } on batches with at most given number of elements . [CODESPLIT] public static < T > Iterable < ArrayList < T > > split ( final Iterable < ? extends T > elements , final int batchSize ) { return new Iterable < ArrayList < T > > ( ) { @ Override public Iterator < ArrayList < T > > iterator ( ) { return new Iterator < ArrayList < T > > ( ) { final Iterator < ? extends T > elementsIterator = elements . iterator ( ) ; @ Override public boolean hasNext ( ) { return elementsIterator . hasNext ( ) ; } @ Override public ArrayList < T > next ( ) { final ArrayList < T > nextBatch = new ArrayList < T > ( batchSize ) ; int count = 0 ; while ( count ++ < batchSize && elementsIterator . hasNext ( ) ) { nextBatch . add ( elementsIterator . next ( ) ) ; } return nextBatch ; } @ Override public void remove ( ) { throw new UnsupportedOperationException ( "Deletion is not supported" ) ; } } ; } } ; }


Input: Splits the input { @link Collection } on batches with at most given number of elements . [CODESPLIT] public static < T > Collection < ArrayList < T > > split ( final Collection < ? extends T > elements , final int batchSize ) { return new AbstractCollection < ArrayList < T > > ( ) { @ Override public Iterator < ArrayList < T > > iterator ( ) { return split ( ( Iterable < ? extends T > ) elements , batchSize ) . iterator ( ) ; } @ Override public int size ( ) { // rounding up return ( elements . size ( ) + batchSize - 1 ) / batchSize ; } } ; }


Input:
Returns read - only view of the given set consisting of the elements satisfying a given condition if the number of such elements is known [CODESPLIT] public static < T > Set < T > filter ( final Set < ? extends T > input , final Condition < ? super T > condition , final int size ) { return new Set < T > ( ) { @ Override public int size ( ) { return size ; } @ Override public boolean isEmpty ( ) { return size == 0 ; } @ Override @ SuppressWarnings ( "unchecked" ) public boolean contains ( Object o ) { if ( ! input . contains ( o ) ) return false ; T elem = null ; try { elem = ( T ) o ; } catch ( ClassCastException cce ) { return false ; } /*
				 * here's why the condition must be consistent with equals(): we
				 * check it on the passed element while we really need to check
				 * it on the element which is in the underlying set (and is
				 * equal to o according to equals()). However, as long as the
				 * condition is consistent, the result will be the same.
				 */ return condition . holds ( elem ) ; } @ Override public Iterator < T > iterator ( ) { return filter ( input , condition ) . iterator ( ) ; } @ Override public Object [ ] toArray ( ) { Object [ ] result = new Object [ size ] ; int i = 0 ; for ( Object o : filter ( input , condition ) ) { result [ i ++ ] = o ; } return result ; } @ Override public < S > S [ ] toArray ( S [ ] a ) { throw new UnsupportedOperationException ( ) ; } @ Override public boolean add ( T e ) { throw new UnsupportedOperationException ( ) ; } @ Override public boolean remove ( Object o ) { throw new UnsupportedOperationException ( ) ; } @ Override public boolean containsAll ( Collection < ? > c ) { for ( Object o : c ) { if ( contains ( o ) ) return false ; } return true ; } @ Override public boolean addAll ( Collection < ? extends T > c ) { throw new UnsupportedOperationException ( ) ; } @ Override public boolean retainAll ( Collection < ? > c ) { throw new UnsupportedOperationException ( ) ; } @ Override public boolean removeAll ( Collection < ? > c ) { throw new UnsupportedOperationException ( ) ; } @ Override public void clear ( ) { throw new UnsupportedOperationException ( ) ; } } ; }


Input: Prints key - value entries present in the first { @link Multimap } but not in the second { @link Multimap } using the given { @link Writer } and prefixing all messages with a given prefix . [CODESPLIT] public static < K , V > void dumpDiff ( Multimap < K , V > first , Multimap < K , V > second , Writer writer , String prefix ) throws IOException { for ( K key : first . keySet ( ) ) { Collection < V > firstValues = first . get ( key ) ; Collection < V > secondValues = second . get ( key ) ; dumpDiff ( firstValues , secondValues , writer , prefix + key + "->" ) ; } }


Input: Prints the elements present in the first { @link Collection } but not in the second { @link Collection } using the given { @link Writer } and prefixing all messages with a given prefix . [CODESPLIT] public static < T > void dumpDiff ( Collection < T > first , Collection < T > second , Writer writer , String prefix ) throws IOException { for ( T element : first ) if ( ! second . contains ( element ) ) writer . append ( prefix + element + "\n" ) ; }


Input: A simple second - order map function for sets [CODESPLIT] public static < I , O > Set < O > map ( final Set < ? extends I > input , final FunctorEx < I , O > functor ) { return new AbstractSet < O > ( ) { @ Override public Iterator < O > iterator ( ) { return new MapIterator < I , O > ( input . iterator ( ) , functor ) ; } @ Override public boolean contains ( Object o ) { I element = functor . deapply ( o ) ; return element == null ? false : input . contains ( element ) ; } @ Override public int size ( ) { return input . size ( ) ; } } ; }


Input:
Returns the bit fragment that encodes the membership of an element for the given position in slices . The returned fragment is an integer whose lower bits correspond to whether an element occurs in the slice or not ( the lowest bit corresponds to the membership in slice = 0 next bit in slice = 1 etc ) [CODESPLIT] static int getFragment ( byte sl , int [ ] masks , int pos ) { /*
		 * one element of the masks table stores fragments for 32/(2^sl)
		 * elements; since it is a power of 2, we can divide on this value and
		 * compute the remainder efficiently
		 */ int shift = ( 5 - sl ) ; int p = pos >> shift ; // = pos / (32/(2^sl)) int r = ( p << shift ) ^ pos ; // the remainder after the devision // extract the r-th fragment of the length 2^sl return ( masks [ p ] >> ( r << sl ) ) & MSK_ [ sl ] ; }


Input: Changes the fragment that corresponds to the encoding of membership of an element at the given position . The change is specified by the bits of the last parameter : bit 1 means the corresponding value of the fragment should flip bit 0 means it should stay the same . [CODESPLIT] static void changeFragment ( byte sl , int [ ] masks , int pos , int diff ) { int shift = ( 5 - sl ) ; int p = pos >> shift ; int r = ( p << shift ) ^ pos ; masks [ p ] ^= diff << ( r << sl ) ; }


Input: Increasing the capacity of the table [CODESPLIT] private void enlarge ( ) { int oldCapacity = data . length ; if ( oldCapacity == LinearProbing . MAXIMUM_CAPACITY ) throw new IllegalArgumentException ( "The set cannot grow beyond the capacity: " + LinearProbing . MAXIMUM_CAPACITY ) ; E [ ] oldData = data ; int [ ] oldMasks = masks ; int newCapacity = oldCapacity << 1 ; @ SuppressWarnings ( "unchecked" ) E [ ] newData = ( E [ ] ) new Object [ newCapacity ] ; int [ ] newMasks = new int [ getMaskCapacity ( logs , newCapacity ) ] ; for ( int i = 0 ; i < oldCapacity ; i ++ ) { E e = oldData [ i ] ; if ( e != null ) addMask ( logs , newData , newMasks , e , getFragment ( logs , oldMasks , i ) ) ; } this . data = newData ; this . masks = newMasks ; }


Input: Decreasing the capacity of the table [CODESPLIT] private void shrink ( ) { int oldCapacity = data . length ; if ( oldCapacity == 1 ) return ; E [ ] oldData = data ; int [ ] oldMasks = masks ; int newCapacity = oldCapacity >> 1 ; @ SuppressWarnings ( "unchecked" ) E [ ] newData = ( E [ ] ) new Object [ newCapacity ] ; int [ ] newMasks = new int [ getMaskCapacity ( logs , newCapacity ) ] ; for ( int i = 0 ; i < oldCapacity ; i ++ ) { E e = oldData [ i ] ; if ( e != null ) addMask ( logs , newData , newMasks , e , getFragment ( logs , oldMasks , i ) ) ; } this . data = newData ; this . masks = newMasks ; }


Input: Inserts a given element into the given slice [CODESPLIT] public boolean add ( int s , E e ) { if ( e == null ) throw new NullPointerException ( ) ; int mask = ( 1 << s ) ; int oldMask = addMask ( logs , data , masks , e , mask ) ; int newMask = oldMask | mask ; if ( newMask == oldMask ) return false ; else if ( oldMask == 0 && ++ occupied == LinearProbing . getUpperSize ( data . length ) ) enlarge ( ) ; sizes [ s ] ++ ; return true ; }


Input: Removes the given object from the given slice [CODESPLIT] public boolean remove ( int s , Object o ) { if ( o == null ) throw new NullPointerException ( ) ; int mask = 1 << s ; int oldMask = removeMask ( logs , data , masks , o , mask ) ; int newMask = oldMask & ~ mask ; if ( newMask == oldMask ) return false ; // else if ( newMask == 0 && -- occupied == LinearProbing . getLowerSize ( data . length ) ) shrink ( ) ; sizes [ s ] -- ; return true ; }


Input: Clears all slices of this { [CODESPLIT] @ SuppressWarnings ( "unchecked" ) public void clear ( ) { int capacity = data . length >> 2 ; if ( capacity == 0 ) capacity = 1 ; initSizes ( ) ; this . data = ( E [ ] ) new Object [ capacity ] ; this . masks = new int [ getMaskCapacity ( logs , capacity ) ] ; }


Input: Generates inferences for SubClassInclusion ( extendedRootMatchExpression rootMatchExpression ) where the arguments correspond to the values of respectively extendedRootMatch and rootMatch under { @link #toElkExpression ( IndexedContextRootMatch ) } [CODESPLIT] private void deriveInclusion ( IndexedContextRootMatch extendedRootMatch , IndexedContextRootMatch rootMatch ) { if ( rootMatch . equals ( extendedRootMatch ) ) { // nothing to do return ; } List < ? extends ElkClassExpression > rootFillers = getFillerRanges ( rootMatch ) ; List < ? extends ElkClassExpression > extendedRootFillers = getFillerRanges ( extendedRootMatch ) ; int rootFillersCount = rootFillers . size ( ) ; if ( rootFillersCount == 1 ) { elkInferenceFactory_ . getElkClassInclusionObjectIntersectionOfDecomposition ( extendedRootFillers , 0 ) ; } else { List < Integer > positions = new ArrayList < Integer > ( rootFillersCount ) ; for ( int i = 0 ; i < rootFillersCount ; i ++ ) { positions . add ( i ) ; } elkInferenceFactory_ . getElkClassInclusionObjectIntersectionOfInclusion ( extendedRootFillers , positions ) ; } }


Input: Adds all counters of the argument to the corresponding counters of this object . The counters should not be directly modified other than using this method during this operation . The counter in the argument will be reseted after this operation . [CODESPLIT] public synchronized void add ( ClassConclusionCounter counter ) { this . countSubClassInclusionDecomposed += counter . countSubClassInclusionDecomposed ; this . countSubClassInclusionComposed += counter . countSubClassInclusionComposed ; this . countBackwardLink += counter . countBackwardLink ; this . countForwardLink += counter . countForwardLink ; this . countContradiction += counter . countContradiction ; this . countPropagation += counter . countPropagation ; this . countDisjointSubsumer += counter . countDisjointSubsumer ; this . countContextInitialization += counter . countContextInitialization ; this . countSubContextInitialization += counter . countSubContextInitialization ; }


Input: Log the start of a particular operation with INFO priority . This method should be used for long - running tasks and is mainly intended . Multiple threads can independently log operations of the same name but ( obviously ) no single thread should use the same operation name to record the start and end of overlapping code . [CODESPLIT] public static void logOperationStart ( String operationName , Logger logger ) { logOperationStart ( operationName , logger , LogLevel . INFO ) ; }


Input: Log the start of a particular operation with the given priority . This method should be used for long - running tasks and is mainly intended . Multiple threads can independently log operations of the same name but ( obviously ) no single thread should use the same operation name to record the start and end of overlapping code . [CODESPLIT] public static void logOperationStart ( String operationName , Logger logger , LogLevel priority ) { if ( LoggerWrap . isEnabledFor ( logger , priority ) ) { LoggerWrap . log ( logger , priority , operationName + " started" ) ; ElkTimer timer = ElkTimer . getNamedTimer ( operationName , ElkTimer . RECORD_WALLTIME ) ; timer . reset ( ) ; // needed in case this was done before timer . start ( ) ; } }


Input: Log the end of a particular operation the beginning of which has been logged using logOperationStart () using INFO priority . [CODESPLIT] public static void logOperationFinish ( String operationName , Logger logger ) { logOperationFinish ( operationName , logger , LogLevel . INFO ) ; }


Input: Log the end of a particular operation the beginning of which has been logged using logOperationStart () using the given logging priority . [CODESPLIT] public static void logOperationFinish ( String operationName , Logger logger , LogLevel priority ) { if ( LoggerWrap . isEnabledFor ( logger , priority ) ) { ElkTimer timer = ElkTimer . getNamedTimer ( operationName , ElkTimer . RECORD_WALLTIME ) ; timer . stop ( ) ; LoggerWrap . log ( logger , priority , operationName + " took " + timer . getTotalWallTime ( ) / 1000000 + " ms" ) ; } }


Input: Log the current total memory usage with the specified priority . [CODESPLIT] public static void logMemoryUsage ( Logger logger , LogLevel priority ) { if ( LoggerWrap . isEnabledFor ( logger , priority ) ) { // Getting the runtime reference from system Runtime runtime = Runtime . getRuntime ( ) ; LoggerWrap . log ( logger , priority , "Memory (MB) Used/Total/Max: " + ( runtime . totalMemory ( ) - runtime . freeMemory ( ) ) / megaBytes + "/" + runtime . totalMemory ( ) / megaBytes + "/" + runtime . maxMemory ( ) / megaBytes ) ; } }


Input: This supposed to be the central place where the reasoner gets its configuration options [CODESPLIT] public synchronized void setConfigurationOptions ( ReasonerConfiguration config ) { this . workerNo_ = config . getParameterAsInt ( ReasonerConfiguration . NUM_OF_WORKING_THREADS ) ; setAllowIncrementalMode ( config . getParameterAsBoolean ( ReasonerConfiguration . INCREMENTAL_MODE_ALLOWED ) ) ; }


Input: Tries to shut down the reasoner within the specified time [CODESPLIT] public synchronized boolean shutdown ( long timeout , TimeUnit unit ) throws InterruptedException { boolean success = true ; if ( success ) { LOGGER_ . info ( "ELK reasoner has shut down" ) ; } else { LOGGER_ . error ( "ELK reasoner failed to shut down!" ) ; } return success ; }


Input: Helper method to get a { @link TaxonomyNode } from the taxonomy . [CODESPLIT] protected TaxonomyNode < ElkClass > getTaxonomyNode ( ElkClass elkClass ) throws ElkException { final Taxonomy < ElkClass > taxonomy = getTaxonomy ( ) ; final TaxonomyNode < ElkClass > node = taxonomy . getNode ( elkClass ) ; if ( node != null ) return node ; // else if ( allowFreshEntities ) return new FreshTaxonomyNode < ElkClass > ( elkClass , taxonomy ) ; // else throw new ElkFreshEntitiesException ( elkClass ) ; }


Input: Helper method to get an { @link InstanceNode } from the taxonomy . [CODESPLIT] protected InstanceNode < ElkClass , ElkNamedIndividual > getInstanceNode ( ElkNamedIndividual elkNamedIndividual ) throws ElkException { final InstanceTaxonomy < ElkClass , ElkNamedIndividual > instanceTaxonomy = getInstanceTaxonomy ( ) ; final InstanceNode < ElkClass , ElkNamedIndividual > node = instanceTaxonomy . getInstanceNode ( elkNamedIndividual ) ; if ( node != null ) return node ; // else if ( allowFreshEntities ) return new FreshInstanceNode < ElkClass , ElkNamedIndividual > ( elkNamedIndividual , instanceTaxonomy ) ; // else throw new ElkFreshEntitiesException ( elkNamedIndividual ) ; }


Input: Helper method to get a { @link TypeNode } from the taxonomy . [CODESPLIT] protected TypeNode < ElkClass , ElkNamedIndividual > getTypeNode ( ElkClass elkClass ) throws ElkException { final InstanceTaxonomy < ElkClass , ElkNamedIndividual > instanceTaxonomy = getInstanceTaxonomy ( ) ; final TypeNode < ElkClass , ElkNamedIndividual > node = instanceTaxonomy . getNode ( elkClass ) ; if ( node != null ) return node ; // else if ( allowFreshEntities ) return new FreshTypeNode < ElkClass , ElkNamedIndividual > ( elkClass , instanceTaxonomy ) ; // else throw new ElkFreshEntitiesException ( elkClass ) ; }


Input: Helper method to get a { @link TaxonomyNode } from the property taxonomy . [CODESPLIT] protected TaxonomyNode < ElkObjectProperty > getObjectPropertyTaxonomyNode ( final ElkObjectProperty elkProperty ) throws ElkException { final Taxonomy < ElkObjectProperty > propertyTaxonomy = getObjectPropertyTaxonomy ( ) ; final TaxonomyNode < ElkObjectProperty > node = propertyTaxonomy . getNode ( elkProperty ) ; if ( node != null ) { return node ; } // else if ( allowFreshEntities ) { return new FreshTaxonomyNode < ElkObjectProperty > ( elkProperty , propertyTaxonomy ) ; } // else throw new ElkFreshEntitiesException ( elkProperty ) ; }


Input: Return the { @code Node } containing equivalent classes of the given { @link ElkClassExpression } . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Node < ElkClass > getEquivalentClasses ( ElkClassExpression classExpression ) throws ElkInconsistentOntologyException , ElkException { if ( classExpression instanceof ElkClass ) { return getTaxonomyNode ( ( ElkClass ) classExpression ) ; } // else return queryEquivalentClasses ( classExpression ) ; }


Input: Return the { @code Node } containing equivalent classes of the given { @link ElkClassExpression } . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Node < ElkClass > getEquivalentClassesQuietly ( ElkClassExpression classExpression ) throws ElkException { try { return getEquivalentClasses ( classExpression ) ; } catch ( final ElkInconsistentOntologyException e ) { // All classes are equivalent to each other, so also to owl:Nothing. return getTaxonomyQuietly ( ) . getBottomNode ( ) ; } }


Input: Return the ( direct or indirect ) subclasses of the given { @link ElkClassExpression } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalent class of subclasses . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkClass > > getSubClasses ( ElkClassExpression classExpression , boolean direct ) throws ElkInconsistentOntologyException , ElkException { if ( classExpression instanceof ElkClass ) { final TaxonomyNode < ElkClass > queryNode = getTaxonomyNode ( ( ElkClass ) classExpression ) ; return direct ? queryNode . getDirectSubNodes ( ) : queryNode . getAllSubNodes ( ) ; } else { final Set < ? extends Node < ElkClass > > subNodes = queryDirectSubClasses ( classExpression ) ; if ( direct ) { return subNodes ; } // else all nodes final Taxonomy < ElkClass > taxonomy = restoreTaxonomy ( ) ; return TaxonomyNodeUtils . getAllReachable ( Operations . map ( subNodes , new Operations . Transformation < Node < ElkClass > , TaxonomyNode < ElkClass > > ( ) { @ Override public TaxonomyNode < ElkClass > transform ( final Node < ElkClass > node ) { return taxonomy . getNode ( node . getCanonicalMember ( ) ) ; } } ) , new Operations . Functor < TaxonomyNode < ElkClass > , Set < ? extends TaxonomyNode < ElkClass > > > ( ) { @ Override public Set < ? extends TaxonomyNode < ElkClass > > apply ( final TaxonomyNode < ElkClass > node ) { return node . getDirectSubNodes ( ) ; } } ) ; } }


Input: Return the ( direct or indirect ) subclasses of the given { @link ElkClassExpression } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalent class of subclasses . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkClass > > getSubClassesQuietly ( final ElkClassExpression classExpression , final boolean direct ) throws ElkException { try { return getSubClasses ( classExpression , direct ) ; } catch ( final ElkInconsistentOntologyException e ) { // All classes are equivalent to each other, so also to owl:Nothing. final TaxonomyNode < ElkClass > node = getTaxonomyQuietly ( ) . getBottomNode ( ) ; return direct ? node . getDirectSubNodes ( ) : node . getAllSubNodes ( ) ; } }


Input: Return the ( direct or indirect ) superclasses of the given { @link ElkClassExpression } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalent class of superclasses . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkClass > > getSuperClasses ( ElkClassExpression classExpression , boolean direct ) throws ElkInconsistentOntologyException , ElkException { if ( classExpression instanceof ElkClass ) { final TaxonomyNode < ElkClass > queryNode = getTaxonomyNode ( ( ElkClass ) classExpression ) ; return direct ? queryNode . getDirectSuperNodes ( ) : queryNode . getAllSuperNodes ( ) ; } else { final Set < ? extends Node < ElkClass > > superNodes = queryDirectSuperClasses ( classExpression ) ; if ( direct ) { return superNodes ; } // else all nodes final Taxonomy < ElkClass > taxonomy = restoreTaxonomy ( ) ; return TaxonomyNodeUtils . getAllReachable ( Operations . map ( superNodes , new Operations . Transformation < Node < ElkClass > , TaxonomyNode < ElkClass > > ( ) { @ Override public TaxonomyNode < ElkClass > transform ( final Node < ElkClass > node ) { return taxonomy . getNode ( node . getCanonicalMember ( ) ) ; } } ) , new Operations . Functor < TaxonomyNode < ElkClass > , Set < ? extends TaxonomyNode < ElkClass > > > ( ) { @ Override public Set < ? extends TaxonomyNode < ElkClass > > apply ( final TaxonomyNode < ElkClass > node ) { return node . getDirectSuperNodes ( ) ; } } ) ; } }


Input: Return the ( direct or indirect ) superclasses of the given { @link ElkClassExpression } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalent class of superclasses . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkClass > > getSuperClassesQuietly ( ElkClassExpression classExpression , boolean direct ) throws ElkException { try { return getSuperClasses ( classExpression , direct ) ; } catch ( final ElkInconsistentOntologyException e ) { // All classes are equivalent to each other, so also to owl:Nothing. final TaxonomyNode < ElkClass > node = getTaxonomyQuietly ( ) . getBottomNode ( ) ; return direct ? node . getDirectSuperNodes ( ) : node . getAllSuperNodes ( ) ; } }


Input: Return the ( direct or indirect ) sub - properties of the given { @link ElkObjectProperty } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalence class of sub - properties . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkObjectProperty > > getSubObjectProperties ( final ElkObjectProperty property , final boolean direct ) throws ElkException { final TaxonomyNode < ElkObjectProperty > queryNode = getObjectPropertyNode ( property ) ; return ( direct ) ? queryNode . getDirectSubNodes ( ) : queryNode . getAllSubNodes ( ) ; }


Input: Return the ( direct or indirect ) super - properties of the given { @link ElkObjectProperty } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalence class of super - properties . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkObjectProperty > > getSuperObjectProperties ( final ElkObjectProperty property , final boolean direct ) throws ElkException { TaxonomyNode < ElkObjectProperty > queryNode = getObjectPropertyNode ( property ) ; return ( direct ) ? queryNode . getDirectSuperNodes ( ) : queryNode . getAllSuperNodes ( ) ; }


Input: Return the ( direct or indirect ) instances of the given { @link ElkClassExpression } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalent class of instances . Calling of this method may trigger the computation of the realization if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkNamedIndividual > > getInstances ( ElkClassExpression classExpression , boolean direct ) throws ElkInconsistentOntologyException , ElkException { if ( classExpression instanceof ElkClass ) { final TypeNode < ElkClass , ElkNamedIndividual > queryNode = getTypeNode ( ( ElkClass ) classExpression ) ; return direct ? queryNode . getDirectInstanceNodes ( ) : queryNode . getAllInstanceNodes ( ) ; } final Set < ? extends Node < ElkNamedIndividual > > instances = queryDirectInstances ( classExpression ) ; if ( direct ) { return instances ; } // else all instances final Set < ? extends Node < ElkClass > > subNodes = queryDirectSubClasses ( classExpression ) ; final InstanceTaxonomy < ElkClass , ElkNamedIndividual > taxonomy = restoreInstanceTaxonomy ( ) ; return TaxonomyNodeUtils . collectFromAllReachable ( Operations . map ( subNodes , new Operations . Transformation < Node < ElkClass > , TypeNode < ElkClass , ElkNamedIndividual > > ( ) { @ Override public TypeNode < ElkClass , ElkNamedIndividual > transform ( final Node < ElkClass > node ) { return taxonomy . getNode ( node . getCanonicalMember ( ) ) ; } } ) , Operations . map ( instances , new Operations . Transformation < Node < ElkNamedIndividual > , InstanceNode < ElkClass , ElkNamedIndividual > > ( ) { @ Override public InstanceNode < ElkClass , ElkNamedIndividual > transform ( final Node < ElkNamedIndividual > node ) { return taxonomy . getInstanceNode ( node . getCanonicalMember ( ) ) ; } } ) , new Operations . Functor < TypeNode < ElkClass , ElkNamedIndividual > , Set < ? extends TypeNode < ElkClass , ElkNamedIndividual > > > ( ) { @ Override public Set < ? extends TypeNode < ElkClass , ElkNamedIndividual > > apply ( final TypeNode < ElkClass , ElkNamedIndividual > node ) { return node . getDirectSubNodes ( ) ; } } , new Operations . Functor < TypeNode < ElkClass , ElkNamedIndividual > , Set < ? extends InstanceNode < ElkClass , ElkNamedIndividual > > > ( ) { @ Override public Set < ? extends InstanceNode < ElkClass , ElkNamedIndividual > > apply ( final TypeNode < ElkClass , ElkNamedIndividual > node ) { return node . getDirectInstanceNodes ( ) ; } } ) ; }


Input: Return the ( direct or indirect ) instances of the given { @link ElkClassExpression } as specified by the parameter . The method returns a set of { @link Node } s each of which representing an equivalent class of instances . Calling of this method may trigger the computation of the realization if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkNamedIndividual > > getInstancesQuietly ( ElkClassExpression classExpression , boolean direct ) throws ElkException { try { return getInstances ( classExpression , direct ) ; } catch ( final ElkInconsistentOntologyException e ) { // All classes are equivalent to each other, so also to owl:Nothing. final TypeNode < ElkClass , ElkNamedIndividual > node = getInstanceTaxonomyQuietly ( ) . getBottomNode ( ) ; return direct ? node . getDirectInstanceNodes ( ) : node . getAllInstanceNodes ( ) ; } }


Input: Return the ( direct or indirect ) types of the given { @link ElkNamedIndividual } . The method returns a set of { @link Node } s each of which representing an equivalent class of types . Calling of this method may trigger the computation of the realization if it has not been done yet . [CODESPLIT] public synchronized Set < ? extends Node < ElkClass > > getTypes ( ElkNamedIndividual elkNamedIndividual , boolean direct ) throws ElkException { InstanceNode < ElkClass , ElkNamedIndividual > node = getInstanceNode ( elkNamedIndividual ) ; return direct ? node . getDirectTypeNodes ( ) : node . getAllTypeNodes ( ) ; }


Input: Check if the given { @link ElkClassExpression } is satisfiable that is if it can possibly have instances . { @link ElkClassExpression } s are not satisfiable if they are equivalent to { @code owl : Nothing } . A satisfiable { @link ElkClassExpression } is also called consistent or coherent . Calling of this method may trigger the computation of the taxonomy if it has not been done yet . [CODESPLIT] public synchronized boolean isSatisfiable ( ElkClassExpression classExpression ) throws ElkException { if ( classExpression instanceof ElkClass ) { final TaxonomyNode < ElkClass > queryNode = getTaxonomyNode ( ( ElkClass ) classExpression ) ; return ! queryNode . contains ( getElkFactory ( ) . getOwlNothing ( ) ) ; } return querySatisfiability ( classExpression ) ; }


Input: Prints the heading together with the separators [CODESPLIT] public void printHeader ( ) { printSeparator ( ) ; addPadding ( ' ' , headerParams_ ) ; logger_ . debug ( String . format ( headerFormat_ , headerParams_ ) ) ; printSeparator ( ) ; }


Input: Appends a string consisting of the given character to the first value so that when the values when formatted have in total { @value #FORMAT_WIDTH_ } characters [CODESPLIT] Object [ ] addPadding ( char c , Object ... values ) { String firstValue = values [ 0 ] . toString ( ) ; int paddingLength = maxPaddingWidth_ - firstValue . length ( ) ; if ( paddingLength > 0 ) { String padding = getString ( c , paddingLength ) ; values [ 0 ] = firstValue + padding ; } return values ; }


Input: Formats and the given values adding padding symbols if necessary . The given array may be modified but the values themselves are not modified . [CODESPLIT] public void print ( Object ... values ) { addPadding ( ' ' , values ) ; logger_ . debug ( String . format ( valuesFormat_ , values ) ) ; }


Input: Creates a string of the given length consisting of the given character [CODESPLIT] static String getString ( char c , int n ) { StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < n ; i ++ ) { sb . append ( c ) ; } return sb . toString ( ) ; }


Input: Defines an ordering on IRIs starting with { @link #OWL_NOTHING } { @link #OWL_THING } followed by the remaining IRIs in alphabetical order . [CODESPLIT] public static int compare ( ElkIri firstIri , ElkIri secondIri ) { boolean isOwl0 = firstIri . equals ( OWL_THING ) || firstIri . equals ( OWL_NOTHING ) ; boolean isOwl1 = secondIri . equals ( OWL_THING ) || secondIri . equals ( OWL_NOTHING ) ; if ( isOwl0 == isOwl1 ) return firstIri . compareTo ( secondIri ) ; // else return isOwl0 ? - 1 : 1 ; }


Input: Arguments are as follows : 0 - name of the reasoning task ( SAT query classification consistency ) 1 - ontology path 2 - output path 3 - concept URI in case of SAT [CODESPLIT] public static void main ( String [ ] args ) throws Exception { Task task = validateArgs ( args ) ; // help if ( task == null ) { printHelp ( ) ; return ; } NativeRunner runner = new NativeRunner ( ) ; runner . run ( args , task ) ; }