Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLDescription


    }


    public void handleTriple(URI subject, URI predicate, URI object) throws OWLException {
        OWLObjectPropertyExpression prop = translateObjectProperty(subject);
        OWLDescription domain = translateDescription(subject);
        addAxiom(getDataFactory().getOWLObjectPropertyDomainAxiom(prop, domain));
    }
View Full Code Here


          OWLClass c = entry.getKey();
          //System.out.println(c.toString());
          Object[] sclasses = c.getSuperClasses(tbox).toArray();
          for (int j = 0; j < sclasses.length && i < s; j++)
          {
            OWLDescription sclassDescription = (OWLDescription) sclasses[j];
            if (sclassDescription.isAnonymous())
              continue;
            OWLClass sclass = sclassDescription.asOWLClass();
            if (sclass != null && !selection.contains(sclass))
            {
              //System.out.println("--->" + sclass.toString());
              selection.add(sclass);
              remainingConcepts.remove(sclass);
View Full Code Here

    final protected OWLDescription translateRestriction(URI mainNode) throws OWLException {
        URI fillerObject = getResourceObject(mainNode, getFillerTriplePredicate(), true);
        if (fillerObject == null) {
            throw new MalformedDescriptionException(getFillerTriplePredicate() + " triple not present");
        }
        OWLDescription desc = translateToDescription(fillerObject);
        return createRestriction(translateOnProperty(mainNode), desc);
    }
View Full Code Here

    public DescriptionNotAllowed visit(OWLObjectSelfRestriction desc) {
      return new DescriptionNotAllowed(desc);
    }

    public DescriptionNotAllowed visit(OWLObjectSomeRestriction desc) {
      OWLDescription filler = desc.getFiller();
      if (filler.isOWLThing())
        return null;
      else
        return new DescriptionNotAllowed(new DescriptionNotAllowed(
            filler), desc);
    }
View Full Code Here

    public DescriptionNotAllowed visit(OWLObjectSelfRestriction desc) {
      return new DescriptionNotAllowed(desc);
    }

    public DescriptionNotAllowed visit(OWLObjectSomeRestriction desc) {
      OWLDescription filler = desc.getFiller();
      if (filler instanceof OWLClass)
        return null;
      else
        return new DescriptionNotAllowed(new DescriptionNotAllowed(
            filler), desc);
View Full Code Here

    }


    public void handleChild(AbstractOWLDescriptionElementHandler handler) throws OWLXMLParserException {
        if(cls == null) {
            OWLDescription desc = handler.getOWLObject();
            if(desc.isAnonymous()) {
                throw new OWLXMLParserUnexpectedElementException(getLineNumber(), "Found anonymous class as first child of disjoint union, expected a named class.");
            }
            cls = (OWLClass) desc;
        }
        else {
View Full Code Here

    public OWLDescription translate(URI mainNode) throws OWLException {
        URI complementOfObject = getResourceObject(mainNode, OWLRDFVocabulary.OWL_COMPLEMENT_OF.getURI(), true);
        if(complementOfObject == null) {
            throw new MalformedDescriptionException(OWLRDFVocabulary.OWL_COMPLEMENT_OF + " triple not present");
        }
        OWLDescription operand = translateToDescription(complementOfObject);
        if(operand == null) {
            throw new MalformedDescriptionException("Could not translate complement of operand");
        }
        return getDataFactory().getOWLObjectComplementOf(operand);
    }
View Full Code Here

    public void handle(String id, String value) {
        URI propURI = getURIFromValue(value.substring(0, value.indexOf(' ')).trim());
        URI fillerURI = getURIFromValue(value.substring(value.indexOf(' '), value.length()).trim());
        OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(propURI);
        OWLClass filler = getDataFactory().getOWLClass(fillerURI);
        OWLDescription restriction = getDataFactory().getOWLObjectSomeRestriction(prop, filler);
        OWLClass subCls = getDataFactory().getOWLClass(getURIFromValue(id));
        applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubClassAxiom(subCls, restriction)));
    }
View Full Code Here

    public void handle(String id, String value) {
        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 boolean canHandleStreaming(URI subject, URI predicate, URI object) throws OWLException {
        if(!getConsumer().isAnonymousNode(subject)) {
            if(getConsumer().isAnonymousNode(object)) {
                OWLDescription superClass = getConsumer().getDescriptionIfTranslated(object);
                if(superClass != null) {
                    potentiallyConsumedTiples++;
                    return true;
                }
            }
View Full Code Here

TOP

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

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.