Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLAxiom


        URI objectTripleObject = getConsumer().getResourceObject(subject, OWLRDFVocabulary.OWL_OBJECT.getURI(), true);
        if(objectTripleObject == null) {
            // Perhaps a legacy mapping
            objectTripleObject = getConsumer().getResourceObject(subject, OWLRDFVocabulary.RDF_OBJECT.getURI(), true);
        }
        OWLAxiom ax = null;
        if (objectTripleObject != null) {
            ax = handleAxiomTriples(subjectTripleObject, predicateTripleObject, objectTripleObject);
        }
        else {
            OWLConstant con = getConsumer().getLiteralObject(subject, OWLRDFVocabulary.RDF_OBJECT.getURI(), true);
View Full Code Here


        }
        URI targetIndividualURI = getConsumer().getResourceObject(subject,
                OWLRDFVocabulary.OWL_TARGET_INDIVIDUAL.getURI(), true);
        OWLConstant targetValue = getConsumer().getLiteralObject(subject,
                OWLRDFVocabulary.OWL_TARGET_VALUE.getURI(), true);
        OWLAxiom ax;
        if( targetIndividualURI != null ) {
            if( targetValue != null ) {
                throw new OWLRDFXMLParserMalformedNodeException(
                        "owl:targetIndividual and owl:targetValue triples with the same subject");
            }
View Full Code Here


    public void handle(String id, String value) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getOWLObjectProperty(id);
            OWLAxiom ax = getDataFactory().getOWLReflexiveObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
        else {
            addAnnotation(id, OBOVocabulary.IS_REFLEXIVE.getName(), getBooleanConstant(false));
        }
View Full Code Here

        super("disjoint_from", consumer);
    }


    public void handle(String id, String value) {
        OWLAxiom ax = getDataFactory().getOWLDisjointClassesAxiom(CollectionFactory.createSet(getCurrentClass(),
                                                                                              getOWLClass(value)));
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

        int index = value.indexOf(' ');
        String propLocalName = value.substring(0, index);
        String val = value.substring(index + 1, value.length());
        OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(getURIFromValue(propLocalName));
        OWLDescription desc = getDataFactory().getOWLObjectSomeRestriction(prop, getClassFromId(val));
        OWLAxiom ax = getDataFactory().getOWLSubClassAxiom(
                getCurrentClass(),
                desc
        );
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here


    public void handle(String id, String value) {
        if(Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(getURIFromValue(id));
            OWLAxiom ax = getDataFactory().getOWLTransitiveObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
    }
View Full Code Here


    public void handleTriple(URI subject, URI predicate, URI object) throws OWLException {
        OWLDescription subClass = translateDescription(subject);
        OWLDescription supClass = translateDescription(object);
        OWLAxiom ax = getDataFactory().getOWLSubClassAxiom(subClass, supClass);
        addAxiom(ax);
        consumeTriple(subject, predicate, object);
    }
View Full Code Here

        while (!orderedMups.isEmpty()) {
            if (progressMonitor.isCancelled()) {
                return;
            }
            OWLAxiom axiom = orderedMups.get(0);
            orderedMups.remove(0);
            if (allMups.size() == maxExplanations) {
                if (log.isLoggable(Level.FINE))
                    log.fine("Computed " + maxExplanations + "explanations");
                return;
            }

            if (log.isLoggable(Level.FINE))
                log.fine("Removing axiom: " + axiom + " " + currentPathContents.size() + " more removed: " + currentPathContents);

            // Remove the current axiom from all the ontologies it is included
            // in

            Set<OWLOntology> ontologies = OntologyUtils.removeAxiom(axiom, getReasoner()
                    .getLoadedOntologies(), getOntologyManager());
           
            // Removal may have dereferenced some entities, if so declarations are added
      Set<OWLEntity> sig = getSignature( axiom );
      List<OWLDeclarationAxiom> temporaryDeclarations = new ArrayList<OWLDeclarationAxiom>(
          sig.size() );
      for( OWLEntity e : sig ) {
        boolean referenced = false;
        for( Iterator<OWLOntology> i = ontologies.iterator(); !referenced && i.hasNext(); ) {
          for( Iterator<OWLAxiom> j = i.next().getReferencingAxioms( e ).iterator(); !referenced
              && j.hasNext(); ) {
            OWLAxiom a = j.next();
            referenced = a.isLogicalAxiom() || (a instanceof OWLDeclarationAxiom);
          }
        }
        if( !referenced ) {
          OWLDeclarationAxiom declaration = getOntologyManager().getOWLDataFactory().getOWLDeclarationAxiom( e );
          temporaryDeclarations.add( declaration );
View Full Code Here


    public void handle(String id, String value) {
        if (Boolean.parseBoolean(value)) {
            OWLObjectProperty prop = getOWLObjectProperty(id);
            OWLAxiom ax = getDataFactory().getOWLSymmetricObjectPropertyAxiom(prop);
            applyChange(new AddAxiom(getOntology(), ax));
        }
        else {
            addAnnotation(id, OBOVocabulary.IS_SYMMETRIC.getName(), getBooleanConstant(false));
        }
View Full Code Here

        super(OBOVocabulary.INVERSE.getName(), consumer);
    }


    public void handle(String id, String value) {
        OWLAxiom ax = getDataFactory().getOWLInverseObjectPropertiesAxiom(getOWLObjectProperty(id),
                                                                          getOWLObjectProperty(value));
        applyChange(new AddAxiom(getOntology(), ax));
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.model.OWLAxiom

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.