Examples of DescriptionGraph


Examples of org.semanticweb.HermiT.model.DescriptionGraph

        if (dlPredicate instanceof LiteralConcept)
            m_extensionManager.addConceptAssertion((LiteralConcept)dlPredicate,getNodeForTerm(termsToNodes,atom.getArgument(0),dependencySet),dependencySet,true);
        else if (dlPredicate instanceof AtomicRole || Equality.INSTANCE.equals(dlPredicate) || Inequality.INSTANCE.equals(dlPredicate))
            m_extensionManager.addAssertion(dlPredicate,getNodeForTerm(termsToNodes,atom.getArgument(0),dependencySet),getNodeForTerm(termsToNodes,atom.getArgument(1),dependencySet),dependencySet,true);
        else if (dlPredicate instanceof DescriptionGraph) {
            DescriptionGraph descriptionGraph=(DescriptionGraph)dlPredicate;
            Object[] tuple=new Object[descriptionGraph.getArity()+1];
            tuple[0]=descriptionGraph;
            for (int argumentIndex=0;argumentIndex<descriptionGraph.getArity();argumentIndex++)
                tuple[argumentIndex+1]=getNodeForTerm(termsToNodes,atom.getArgument(argumentIndex),dependencySet);
            m_extensionManager.addTuple(tuple,dependencySet,true);
        }
        else
            throw new IllegalArgumentException("Unsupported type of positive ground atom.");
View Full Code Here

Examples of org.semanticweb.HermiT.model.DescriptionGraph

        m_extensionTablesByIndex=new ExtensionTable[extensionTablesByIndex.size()];
        extensionTablesByIndex.toArray(m_extensionTablesByIndex);
        m_auxiliaryTuples1=new Object[m_descriptionGraphsByIndex.length][];
        m_auxiliaryTuples2=new Object[m_descriptionGraphsByIndex.length][];
        for (int index=0;index<m_descriptionGraphsByIndex.length;index++) {
            DescriptionGraph descriptionGraph=m_descriptionGraphsByIndex[index];
            m_auxiliaryTuples1[index]=new Object[descriptionGraph.getNumberOfVertices()+1];
            m_auxiliaryTuples2[index]=new Object[descriptionGraph.getNumberOfVertices()+1];
        }
        m_newNodes=new ArrayList<Node>();
        m_binaryUnionDependencySet=new UnionDependencySet(2);
        m_deltaOldRetrievals=new ExtensionTable.Retrieval[extensionTables.size()];
        int index=0;
View Full Code Here

Examples of org.semanticweb.HermiT.model.DescriptionGraph

        m_binaryUnionDependencySet.m_dependencySets[1]=null;
        for (ExtensionTable.Retrieval retrieval : m_deltaOldRetrievals)
            retrieval.clear();
    }
    public Object[] getDescriptionGraphTuple(int graphIndex,int tupleIndex) {
        DescriptionGraph descriptionGraph=m_descriptionGraphsByIndex[graphIndex];
        ExtensionTable extensionTable=m_extensionTablesByIndex[graphIndex];
        Object[] tuple=new Object[descriptionGraph.getNumberOfVertices()+1];
        extensionTable.retrieveTuple(tuple,tupleIndex);
        return tuple;
    }
View Full Code Here

Examples of org.semanticweb.HermiT.model.DescriptionGraph

    }
    public void expand(ExistsDescriptionGraph existsDescriptionGraph,Node forNode) {
        if (m_tableau.m_tableauMonitor!=null)
            m_tableau.m_tableauMonitor.existentialExpansionStarted(existsDescriptionGraph,forNode);
        m_newNodes.clear();
        DescriptionGraph descriptionGraph=existsDescriptionGraph.getDescriptionGraph();
        DependencySet dependencySet=m_extensionManager.getConceptAssertionDependencySet(existsDescriptionGraph,forNode);
        Object[] auxiliaryTuple=m_auxiliaryTuples1[m_descriptionGraphIndices.get(descriptionGraph).intValue()];
        auxiliaryTuple[0]=descriptionGraph;
        for (int vertex=0;vertex<descriptionGraph.getNumberOfVertices();vertex++) {
            Node newNode;
            if (vertex==existsDescriptionGraph.getVertex())
                newNode=forNode;
            else
                newNode=m_tableau.createNewGraphNode(forNode.getClusterAnchor(),dependencySet);
            m_newNodes.add(newNode);
            auxiliaryTuple[vertex+1]=newNode;
        }
        m_extensionManager.addTuple(auxiliaryTuple,dependencySet,true);
        // Replace all nodes with the canonical node because the nodes might have been merged
        for (int vertex=0;vertex<descriptionGraph.getNumberOfVertices();vertex++) {
            Node newNode=m_newNodes.get(vertex);
            dependencySet=newNode.addCanonicalNodeDependencySet(dependencySet);
            m_newNodes.set(vertex,newNode.getCanonicalNode());
        }
        // Now add the graph layout
        for (int vertex=0;vertex<descriptionGraph.getNumberOfVertices();vertex++)
            m_extensionManager.addConceptAssertion(descriptionGraph.getAtomicConceptForVertex(vertex),m_newNodes.get(vertex),dependencySet,true);
        for (int edgeIndex=0;edgeIndex<descriptionGraph.getNumberOfEdges();edgeIndex++) {
            DescriptionGraph.Edge edge=descriptionGraph.getEdge(edgeIndex);
            m_extensionManager.addRoleAssertion(edge.getAtomicRole(),m_newNodes.get(edge.getFromVertex()),m_newNodes.get(edge.getToVertex()),dependencySet,true);
        }
        m_newNodes.clear();
        if (m_tableau.m_tableauMonitor!=null)
            m_tableau.m_tableauMonitor.existentialExpansionFinished(existsDescriptionGraph,forNode);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.