Java 类org.semanticweb.owlapi.model.OWLClass 实例源码

项目:geoxygene    文件:OntologyBrowser.java   
private void buildTreeModel() {
  // first get all classes of the ontology
  Collection<OWLClass> classes = this.ontology.getClassesInSignature();
  // get the root of the tree model (the "Thing" OWL Class)
  DefaultMutableTreeNode root = null;
  for (OWLClass owlClass : classes) {
    if (owlClass.getIRI().getFragment().equals(rootConcept)) {
      root = new DefaultMutableTreeNode(owlClass);
      break;
    }
  }
  if (root == null) {
    return;
  }
  classes.remove(root.getUserObject());

  // now, add all remaining classes to the root by specialisation
  this.addSubClasses(root);
}
项目:SemanticSCo    文件:SemanticReasoner.java   
public LinkedList<String> findEquivalentClasses(){

    LinkedList<String> equivalentClasses = new LinkedList<>();

    //Get all equivalent classes and set LinkedList equivalentClasses
    Set<OWLClass> classes = classifier.getEquivalentClasses(owlClass).getEntities();

    //For each equivalent class
    Iterator it = classes.iterator();
    while(it.hasNext()){
        OWLClass oClass = (OWLClass)it.next();
        //Add to LinkedList equivalentClasses
        if(!oClass.isOWLThing())
            equivalentClasses.add(oClass.getIRI().toString());
    }

    return equivalentClasses;
}
项目:SemanticSCo    文件:SemanticReasoner.java   
public LinkedList<String> findIndirectSubclasses(){

    LinkedList<String> indirectSubclasses = new LinkedList<>();

    //Get all subclasses and add them to LinkedList "indirectSubclasses"
    Set<OWLClass> subClasses = classifier.getSubClasses(owlClass,false).getFlattened();
    Iterator it = subClasses.iterator();
    while(it.hasNext()){
        OWLClass oClass = (OWLClass)it.next();
        //If is not the element owl:Nothing, add to LinkedList indirectSubclasses
        if(!oClass.isOWLNothing())
            indirectSubclasses.add(oClass.getIRI().toString());
    }

    //Remove direct subclasses from LinkedList "indirectSubclasses"
    indirectSubclasses.removeAll(findDirectSubclasses());

    return indirectSubclasses;
}
项目:BENGAL    文件:Verbalizer.java   
/**
 * Returns the most specific type of a given individual.
 * 
 * @param ind
 * @return
 */
private OWLClass getMostSpecificType(OWLIndividual ind) {
    logger.debug("Getting the most specific type of " + ind);
    String query = String.format("PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> \n"
            + "select distinct ?type where {" + " <%s> a ?type ." + "?type rdfs:label []."
            // + "?type a owl:Class ." // too strict, thus currently omitted
            + "filter not exists {?subtype ^a <%s> ; rdfs:subClassOf ?type .filter(?subtype != ?type)}}",
            ind.toStringID(), ind.toStringID());
    SortedSet<OWLClass> types = new TreeSet<OWLClass>();

    QueryExecution qe = qef.createQueryExecution(query);
    ResultSet rs = qe.execSelect();
    while (rs.hasNext()) {
        QuerySolution qs = rs.next();
        if (qs.get("type").isURIResource()) {
            types.add(new OWLClassImpl(IRI.create(qs.getResource("type").getURI())));
        }
    }
    qe.close();

    // of more than one type exists, we have to choose one
    // TODO

    return types.first();
}
项目:ccp-nlp    文件:OntologyClassRemovalFilter_AE.java   
@Override
public void initialize(UimaContext context) throws ResourceInitializationException {
    super.initialize(context);
    try {
        ontUtil = new OntologyUtil(ontologyFile);

        /*
         * check that the term to remove is in the ontology -- if it is not,
         * it could be a format issue
         */
        OWLClass cls = ontUtil.getOWLClassFromId(termIdToRemove);
        if (cls == null) {
            String errorMessage = "Ontology term ID selected for removal is not in the given ontology. "
                    + "This could be a formatting issue. Term selected for removal: " + termIdToRemove
                    + " Example term ID from the ontology: " + ontUtil.getClassIterator().next().toStringID();
            throw new ResourceInitializationException(new IllegalArgumentException(errorMessage));
        }

    } catch (OWLOntologyCreationException e) {
        throw new ResourceInitializationException(e);
    }
    annotationDataExtractor = (AnnotationDataExtractor) ConstructorUtil
            .invokeConstructor(annotationDataExtractorClassName);
}
项目:OntoBench    文件:RdfsLabelMultiLanguageFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":propertyWithInfos");
  OWLClass range = featurePool.getExclusiveClass(":ClassWithInfos");
  OWLAnnotationProperty label = factory.getRDFSLabel();

  OWLAnnotation enAnnotation = factory.getOWLAnnotation(label, factory.getOWLLiteral("Label of a property", Locale.ENGLISH.getLanguage()));
  OWLAnnotation deAnnotation = factory.getOWLAnnotation(label, factory.getOWLLiteral("Bezeichnung einer Property", Locale.GERMAN.getLanguage()));
  OWLAnnotation jpAnnotation = factory.getOWLAnnotation(label, factory.getOWLLiteral("プロパティの指定", Locale.JAPANESE.getLanguage()));

  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(property.getIRI(), deAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(property.getIRI(), enAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(property.getIRI(), jpAnnotation));

  OWLAnnotation enClassAnnotation = factory.getOWLAnnotation(label, factory.getOWLLiteral("Label of a class", Locale.ENGLISH.getLanguage()));
  OWLAnnotation deClassAnnotation = factory.getOWLAnnotation(label, factory.getOWLLiteral("Bezeichnung einer Klasse", Locale.GERMAN.getLanguage()));
  OWLAnnotation jpClassAnnotation = factory.getOWLAnnotation(label, factory.getOWLLiteral("どうもありがとうミスターロボット", Locale.JAPANESE.getLanguage()));

  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(range.getIRI(), enClassAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(range.getIRI(), deClassAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(range.getIRI(), jpClassAnnotation));


  addToGenericDomainAndNewRange(property, range);
}
项目:OntoBench    文件:RdfsCommentMultiLanguageFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":propertyWithInfos");
  OWLClass range = featurePool.getExclusiveClass(":ClassWithInfos");
  OWLAnnotationProperty comment = factory.getRDFSComment();

  OWLAnnotation enAnnotation = factory.getOWLAnnotation(comment, factory.getOWLLiteral("Comment of a property", Locale.ENGLISH.getLanguage()));
  OWLAnnotation deAnnotation = factory.getOWLAnnotation(comment, factory.getOWLLiteral("Kommentar einer Property", Locale.GERMAN.getLanguage()));
  OWLAnnotation jpAnnotation = factory.getOWLAnnotation(comment, factory.getOWLLiteral("プロパティのコメント", Locale.JAPANESE.getLanguage()));

  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(property.getIRI(), deAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(property.getIRI(), enAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(property.getIRI(), jpAnnotation));


  OWLAnnotation enClassAnnotation = factory.getOWLAnnotation(comment, factory.getOWLLiteral("Comment of a class", Locale.ENGLISH.getLanguage()));
  OWLAnnotation deClassAnnotation = factory.getOWLAnnotation(comment, factory.getOWLLiteral("Kommentar einer Klasse", Locale.GERMAN.getLanguage()));
  OWLAnnotation jpClassAnnotation = factory.getOWLAnnotation(comment, factory.getOWLLiteral("どうもありがとうミスターロボット", Locale.JAPANESE.getLanguage()));

  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(range.getIRI(), enClassAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(range.getIRI(), deClassAnnotation));
  addAxiomToOntology(factory.getOWLAnnotationAssertionAxiom(range.getIRI(), jpClassAnnotation));

  addToGenericDomainAndNewRange(property, range);
}
项目:SemanticSCo    文件:SemanticReasoner.java   
public LinkedList<String> findIndirectSuperclasses(){

    LinkedList<String> indirectSuperclasses = new LinkedList<>();

    //Get all superclasses and add them to LinkedList "indirectSuperclasses"
    Set<OWLClass> superClasses = classifier.getSuperClasses(owlClass,false).getFlattened();
    Iterator it = superClasses.iterator();
    while(it.hasNext()){
        OWLClass oClass = (OWLClass)it.next();
        //If is not the element owl:Thing, add to LinkedList indirectSuperclasses
        if(!oClass.isOWLThing())
            indirectSuperclasses.add(oClass.getIRI().toString());
    }

    //Remove direct superclasses from LinkedList "indirectSuperclasses"
    indirectSuperclasses.removeAll(findDirectSuperclasses());

    return indirectSuperclasses;
}
项目:OntoBench    文件:OwlPropertyChainAxiomFeature.java   
@Override
public void addToOntology() {
  OWLClass start = featurePool.getReusableClass();
  OWLClass middle = featurePool.getExclusiveClass(":PropertyChainMiddle");
  OWLClass end = featurePool.getExclusiveClass(":PropertyChainEnd");

  OWLObjectProperty singleStep = featurePool.getExclusiveProperty(":propertyChainProperty_SingleStep");
  OWLObjectProperty doubleStep = featurePool.getExclusiveProperty(":propertyChainProperty_DoubleStep");

  List<OWLObjectProperty> propertyChain = Arrays.asList(singleStep, singleStep);
  addAxiomToOntology(factory.getOWLSubPropertyChainOfAxiom(propertyChain, doubleStep));

  addProperty(end, singleStep, middle);
  addProperty(middle, singleStep, start);
  addProperty(end, doubleStep, start);
}
项目:BENGAL    文件:Verbalizer.java   
/**
 * Returns a textual summary of the given entity.
 *
 * @return
 */
public Map<OWLIndividual, String> getSummaries(Set<OWLIndividual> individuals, OWLClass nc, String namespace,
        double threshold, Cooccurrence cooccurrence, HardeningType hType) {
    Map<OWLIndividual, String> entity2Summaries = new HashMap<OWLIndividual, String>();

    Map<OWLIndividual, List<NLGElement>> verbalize = verbalize(individuals, nc, namespace, threshold, cooccurrence,
            hType);
    for (Entry<OWLIndividual, List<NLGElement>> entry : verbalize.entrySet()) {
        OWLIndividual individual = entry.getKey();
        List<NLGElement> elements = entry.getValue();
        String summary = realize(elements);
        summary = summary.replaceAll("\\s?\\((.*?)\\)", "");
        summary = summary.replace(" , among others,", ", among others,");
        entity2Summaries.put(individual, summary);
    }

    return entity2Summaries;
}
项目:BENGAL    文件:Verbalizer.java   
/**
 * Returns a list of synonymous expressions as subject for the given
 * resource.
 * 
 * @param resource
 *            the resource
 * @param resourceType
 *            the type of the resource
 * @param resourceGender
 *            the gender of the resource
 * @return list of synonymous expressions
 */
public List<NPPhraseSpec> generateSubjects(Resource resource, OWLClass resourceType, Gender resourceGender) {
    List<NPPhraseSpec> result = new ArrayList<NPPhraseSpec>();
    // the textual representation of the resource itself
    result.add(nlg.getNPPhrase(resource.getURI(), false, false));
    // the class, e.g. 'this book'
    NPPhraseSpec np = nlg.getNPPhrase(resourceType.toStringID(), false);
    np.addPreModifier("This");
    result.add(np);
    // the pronoun depending on the gender of the resource
    if (resourceGender.equals(Gender.MALE)) {
        result.add(nlg.nlgFactory.createNounPhrase("he"));
    } else if (resourceGender.equals(Gender.FEMALE)) {
        result.add(nlg.nlgFactory.createNounPhrase("she"));
    } else {
        result.add(nlg.nlgFactory.createNounPhrase("it"));
    }
    return result;
}
项目:SemanticSCo    文件:SemanticReasoner.java   
public LinkedList<String> findDirectSuperclasses(){

    LinkedList<String> directSuperclasses = new LinkedList<>();

    //Get all direct superclasses and set LinkedList directSuperclasses
    Set<OWLClass> superClasses = classifier.getSuperClasses(owlClass,true).getFlattened();

    //For each direct superclass
    Iterator it = superClasses.iterator();
    while(it.hasNext()){
        OWLClass oClass = (OWLClass)it.next();
        //If is not the element owl:Thing, add to LinkedList directSuperclasses
        if(!oClass.isOWLThing())
            directSuperclasses.add(oClass.getIRI().toString());
    }

    return directSuperclasses;
}
项目:onagui    文件:OWLAPIContainer.java   
@Override
public Set<OWLEntity> getParents(OWLEntity cpt) {
    if(!cpt.isOWLClass()) return new HashSet<OWLEntity>();

    Set<OWLEntity> entities = new HashSet<OWLEntity>();
    Set<OWLEntity> result = new HashSet<OWLEntity>();
    OWLClass localRootClass = cpt.asOWLClass();
    entities.addAll(reasoner.getSuperClasses(localRootClass, true).getFlattened());
    for(OWLEntity parentClass : entities) {
        // Only Class
        if(!parentClass.isOWLClass())
        {
            continue;
        }
        // Not Nothing
        if(parentClass.isOWLClass() && parentClass.asOWLClass().isOWLNothing())
        {
            continue;
        }
        result.add(parentClass);
    }
    return result;
}
项目:OBEP    文件:AbstracterImpl.java   
@Override
public void sendEvent(SemanticEvent se) {
    Set<String> triggeredFilters = new HashSet<String>();
    // add event to ontology
    manager.addAxioms(ontology, se.getAxioms());
    // extract types event
    reasoner.flush();

    NodeSet<OWLClass> inferedClasses = reasoner.getTypes(se.getMessage(), false);
    for (OWLClass owlclss : inferedClasses.getFlattened()) {
        String clss = owlclss.getIRI().toString();
        if (eventDefinitions.contains(clss)) {
            triggeredFilters.add(clss);
        }
    }
    se.setTriggeredFilterIRIs(triggeredFilters);

    //send event back to engie
    obep.sendEvent(se);
}
项目:OntoBench    文件:AbstractDatatypeMapFeature.java   
@Override
public void addToOntology() {
  OWLClass domain = featurePool.getExclusiveClass(":DatatypeMapsDomain");
  OWLDatatype range = factory.getOWLDatatype(datatype);

  String namespace = datatype.getPrefixedName().split(":")[0];
  String name = datatype.getShortForm();
  String propertyIri = ":" + namespace + WordUtils.capitalize(name) + "Property";
  OWLDataProperty property = factory.getOWLDataProperty(propertyIri, pm);

  addProperty(domain, property, range);
}
项目:OntoBench    文件:AnonymousIndividualFeature.java   
@Override
public void addToOntology() {
  OWLClass clazz = featurePool.getReusableClass();
  OWLAnonymousIndividual individual = factory.getOWLAnonymousIndividual();

  addAxiomToOntology(factory.getOWLClassAssertionAxiom(clazz, individual));
}
项目:OntoBench    文件:NamedIndividualFeature.java   
@Override
public void addToOntology() {
  OWLClass clazz = featurePool.getReusableClass();
  OWLNamedIndividual individual = factory.getOWLNamedIndividual(":NamedIndividual", pm);

  addAxiomToOntology(factory.getOWLClassAssertionAxiom(clazz, individual));
}
项目:OntoBench    文件:MultipleIndividualsFeature.java   
@Override
public void addToOntology() {
  OWLClass clazz = featurePool.getExclusiveClass(baseIri);
  List<OWLNamedIndividual> individuals = new ArrayList<>(individualCount);

  for (int i = 1; i <= individualCount; i++) {
    individuals.add(factory.getOWLNamedIndividual(baseIri + "_" + i, pm));
  }

  individuals.forEach(individual -> addAxiomToOntology(factory.getOWLClassAssertionAxiom(clazz, individual)));
}
项目:SemanticSCo    文件:SemanticReasoner.java   
public String getLabel(String entity){

    String label= " ";

    try{
        //Create OWL class for entity
        OWLClass entityClass = OWL.Class(entity);

        //Try to load ontology into OWLOntology object. If it fails, an exception is generated
        OWLOntology ontology = OWL.manager.loadOntologyFromOntologyDocument(entityClass.getIRI());

        //Extract annotations associated to the OWL class
        Set<OWLAnnotation> annotations = entityClass.getAnnotations(ontology);

        //Remove ontology from manager
        OWL.manager.removeOntology(ontology);

        //For each annotation, if it is a label, set variable "label"
        Iterator it = annotations.iterator();
        while(it.hasNext()){
            OWLAnnotation annotation = (OWLAnnotation) it.next();
            if(annotation.getProperty().isLabel())
                label = annotation.getValue().toString().split("\"")[1];
        }

    }catch(OWLOntologyCreationException ex){
        return label;
    }

    return label;
}
项目:OntoBench    文件:OwlDataMinCardinalityFeature.java   
@Override
public void addToOntology() {
  OWLDataProperty property = factory.getOWLDataProperty(":dataMinCardinality", pm);
  OWLDatatype datatype = OWL2Datatype.XSD_BOOLEAN.getDatatype(factory);
  addToGenericDomainAndNewRange(property, datatype);

  OWLClass range = featurePool.getExclusiveClass(":DataMinCardinalityRange");
  OWLDataMinCardinality cardinality = factory.getOWLDataMinCardinality(3, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality));
}
项目:OntoBench    文件:OwlDataMaxCardinalityOwl2RlFeature.java   
@Override
public void addToOntology() {
  OWLDataProperty property = factory.getOWLDataProperty(":dataMaxCardinality_RL", pm);
  OWLDatatype datatype = OWL2Datatype.XSD_FLOAT.getDatatype(factory);
  addToGenericDomainAndNewRange(property, datatype);

  OWLClass range = featurePool.getExclusiveClass(":DataMaxCardinalityRange_RL");
  OWLDataMaxCardinality cardinality = factory.getOWLDataMaxCardinality(1, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality));
}
项目:OntoBench    文件:OwlDataCardinalityFeature.java   
@Override
public void addToOntology() {
  OWLDataProperty property = factory.getOWLDataProperty(":dataExactCardinality", pm);
  OWLDatatype datatype = OWL2Datatype.XSD_STRING.getDatatype(factory);
  addToGenericDomainAndNewRange(property, datatype);

  OWLClass range = featurePool.getExclusiveClass(":DataExactCardinalityRange");
  OWLDataExactCardinality cardinality = factory.getOWLDataExactCardinality(11, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, cardinality));
}
项目:OntoBench    文件:OwlDataHasValueFeature.java   
@Override
public void addToOntology() {
  OWLDataProperty property = factory.getOWLDataProperty(":dataHasValueProperty", pm);

  OWLDataHasValue restriction = factory.getOWLDataHasValue(property, factory.getOWLLiteral(6));
  addToGenericDomainAndNewRange(property, OWL2Datatype.XSD_NON_NEGATIVE_INTEGER.getDatatype(factory));

  OWLClass hasValue = featurePool.getExclusiveClass(":DataHasValue");
  addAxiomToOntology(factory.getOWLSubClassOfAxiom(hasValue, restriction));
}
项目:OntoBench    文件:OwlDataSomeValuesFromOwl2RlFeature.java   
@Override
public void addToOntology() {
  OWLDataProperty property = factory.getOWLDataProperty(":dataSomeValuesFromProperty_RL", pm);
  OWLDatatype datatype = OWL2Datatype.XSD_DATE_TIME.getDatatype(factory);

  OWLClass range = featurePool.getExclusiveClass(":DataSomeValuesFrom_RL");
  OWLDataSomeValuesFrom restriction = factory.getOWLDataSomeValuesFrom(property, datatype);
  addAxiomToOntology(factory.getOWLSubClassOfAxiom(restriction, range));
}
项目:OntoBench    文件:OwlDataSomeValuesFromFeature.java   
@Override
public void addToOntology() {
  OWLDataProperty property = factory.getOWLDataProperty(":dataSomeValuesFromProperty", pm);
  OWLDatatype datatype = OWL2Datatype.XSD_DATE_TIME.getDatatype(factory);

  OWLClass someValuesFrom = featurePool.getExclusiveClass(":DataSomeValuesFrom");
  OWLDataSomeValuesFrom restriction = factory.getOWLDataSomeValuesFrom(property, datatype);
  addAxiomToOntology(factory.getOWLSubClassOfAxiom(someValuesFrom, restriction));
}
项目:OntoBench    文件:OwlDataAllValuesFromFeature.java   
@Override
public void addToOntology() {
  OWLDataProperty property = factory.getOWLDataProperty(":dataAllValuesFromProperty", pm);
  OWLDatatype value = OWL2Datatype.XSD_INTEGER.getDatatype(factory);
  addToGenericDomainAndNewRange(property, value);

  OWLDataAllValuesFrom restriction = factory.getOWLDataAllValuesFrom(property, value);

  OWLClass allValuesFrom = featurePool.getExclusiveClass(":DataAllValuesFrom");
  addAxiomToOntology(factory.getOWLSubClassOfAxiom(allValuesFrom, restriction));
}
项目:OntoBench    文件:OwlObjectCardinalityOwlLiteFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectExactCardinalityProperty_Lite");
  OWLClass range = featurePool.getExclusiveClass(":ObjectExactCardinalityRange_Lite");
  addToGenericDomainAndNewRange(property, range);

  OWLObjectExactCardinality exactCardinality = factory.getOWLObjectExactCardinality(1, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, exactCardinality));
}
项目:OntoBench    文件:OwlObjectMaxCardinalityOwlLiteAnd2RlFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectMaxCardinalityProperty_LiteRL");
  OWLClass range = featurePool.getExclusiveClass(":ObjectMaxCardinalityRange_LiteRL");
  addToGenericDomainAndNewRange(property, range);

  OWLObjectMaxCardinality maxCardinality = factory.getOWLObjectMaxCardinality(1, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, maxCardinality));
}
项目:OntoBench    文件:OwlObjectMaxQualifiedCardinalityOwl2RlFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectMaxQualifiedCardinalityProperty_RL");
  OWLClass range = featurePool.getExclusiveClass(":ObjectMaxQualifiedCardinalityRange_RL");
  addToGenericDomainAndNewRange(property, range);

  OWLClass qualifier = featurePool.getExclusiveClass(":ObjectMaxQualifiedCardinality_RL_Qualifier");
  OWLObjectMaxCardinality maxCardinality = factory.getOWLObjectMaxCardinality(0, property, qualifier);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, maxCardinality));
}
项目:OntoBench    文件:OwlObjectCardinalityFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectExactCardinalityProperty");
  OWLClass range = featurePool.getExclusiveClass(":ObjectExactCardinalityRange");
  addToGenericDomainAndNewRange(property, range);

  OWLObjectExactCardinality exactCardinality = factory.getOWLObjectExactCardinality(4, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, exactCardinality));
}
项目:OntoBench    文件:OwlObjectMinCardinalityOwlLiteFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectMinCardinalityProperty_Lite");
  OWLClass range = featurePool.getExclusiveClass(":ObjectMinCardinalityRange_Lite");
  addToGenericDomainAndNewRange(property, range);

  OWLObjectMinCardinality minCardinality = factory.getOWLObjectMinCardinality(0, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, minCardinality));
}
项目:geoxygene    文件:OntologyBrowser.java   
private void addSubClasses(DefaultMutableTreeNode node) {
  OWLClass owlClass = (OWLClass) node.getUserObject();
  for (OWLClassExpression c : owlClass.getSubClasses(this.ontology)) {
    if (!OWLClass.class.isInstance(c)) {
      continue;
    }
    OWLClass subClass = (OWLClass) c;
    DefaultMutableTreeNode subNode = new DefaultMutableTreeNode(subClass);
    node.add(subNode);
    if (subClass.getSubClasses(this.ontology).size() != 0) {
      this.addSubClasses(subNode);
    }
  }
}
项目:OntoBench    文件:OwlObjectMaxCardinalityFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectMaxCardinalityProperty");
  OWLClass range = featurePool.getExclusiveClass(":ObjectMaxCardinalityRange");
  addToGenericDomainAndNewRange(property, range);

  OWLObjectMaxCardinality maxCardinality = factory.getOWLObjectMaxCardinality(8, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, maxCardinality));
}
项目:OntoBench    文件:OwlObjectQualifiedCardinalityFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectExactQualifiedCardinalityProperty");
  OWLClass range = featurePool.getExclusiveClass(":ObjectExactQualifiedCardinalityRange");
  addToGenericDomainAndNewRange(property, range);

  OWLClass qualifier = featurePool.getExclusiveClass(":ObjectExactQualifiedCardinality_Qualifier");
  OWLObjectExactCardinality exactCardinality = factory.getOWLObjectExactCardinality(1, property, qualifier);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, exactCardinality));
}
项目:OntoBench    文件:OwlObjectSomeValuesFromOwl2RlFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectSomeValuesFromProperty_RL");
  OWLClass range = featurePool.getExclusiveClass(":ObjectSomeValuesFromRange_RL");

  OWLClass someValuesFrom = featurePool.getExclusiveClass(":ObjectSomeValuesFrom_RL");
  OWLObjectSomeValuesFrom restriction = factory.getOWLObjectSomeValuesFrom(property, range);
  addAxiomToOntology(factory.getOWLSubClassOfAxiom(restriction, someValuesFrom));
}
项目:OntoBench    文件:OwlHasSelfFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":hasSelfProperty");

  OWLClass hasSelf = featurePool.getExclusiveClass(":HasSelfClass");

  OWLObjectHasSelf restriction = factory.getOWLObjectHasSelf(property);
  addAxiomToOntology(factory.getOWLEquivalentClassesAxiom(hasSelf, restriction));
}
项目:ccp-nlp    文件:OboToDictionary.java   
/**
 * @param oboObj
 * @param subTreeRootIdsToInclude
 * @return
 */
private static boolean classInIncludedSubtree(OWLClass oboObj, Set<OWLClass> subTreeRootIdsToInclude,
        OntologyUtil ontUtil) {
    if (subTreeRootIdsToInclude == null) {
        return true;
    }
    Set<OWLClass> ancestors = ontUtil.getAncestors(oboObj);
    for (OWLClass ancestor : ancestors) {
        if (subTreeRootIdsToInclude.contains(ancestor)) {
            return true;
        }
    }
    return false;
}
项目:OntoBench    文件:OwlObjectHasValueFeature.java   
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectHasValueProperty");

  OWLIndividual value = factory.getOWLNamedIndividual(":ObjectHasValue_Individual", pm);
  OWLObjectHasValue restriction = factory.getOWLObjectHasValue(property, value);

  OWLClass hasValue = featurePool.getExclusiveClass(":ObjectHasValue");
  addAxiomToOntology(factory.getOWLSubClassOfAxiom(hasValue, restriction));
}
项目:OntoBench    文件:OwlThingFeature.java   
@Override
public void addToOntology() {
  OWLClass owlThing = factory.getOWLThing();
  OWLAxiom axiom = factory.getOWLDeclarationAxiom(owlThing);

  addAxiomToOntology(axiom);
}
项目:OntoBench    文件:OwlClassFeature.java   
@Override
public void addToOntology() {
  OWLClass owlClass = featurePool.getReusableClass();
  OWLAxiom axiom = factory.getOWLDeclarationAxiom(owlClass);

  addAxiomToOntology(axiom);
}