Search in sources :

Example 16 with OWLLiteral

use of org.semanticweb.owlapi.model.OWLLiteral in project stanbol by apache.

the class OntologyNetworkConfigurationUtils method getScopesToActivate.

/**
     * Get the list of scopes to activate on startup
     * 
     * @param config
     * @return
     */
public static String[] getScopesToActivate(OWLOntology config) {
    Set<OWLIndividual> scopes = cScope.getIndividuals(config);
    List<String> result = new ArrayList<String>();
    boolean doActivate = false;
    for (OWLIndividual iScope : scopes) {
        Set<OWLLiteral> activate = iScope.getDataPropertyValues(activateOnStart, config);
        Iterator<OWLLiteral> it = activate.iterator();
        while (it.hasNext() && !doActivate) {
            OWLLiteral l = it.next();
            doActivate |= Boolean.parseBoolean(l.getLiteral());
        }
        if (iScope.isNamed() && doActivate)
            result.add(((OWLNamedIndividual) iScope).getIRI().toString());
    }
    return result.toArray(EMPTY_IRI_ARRAY);
}
Also used : OWLLiteral(org.semanticweb.owlapi.model.OWLLiteral) ArrayList(java.util.ArrayList) OWLIndividual(org.semanticweb.owlapi.model.OWLIndividual)

Aggregations

OWLLiteral (org.semanticweb.owlapi.model.OWLLiteral)16 OWLDataFactory (org.semanticweb.owlapi.model.OWLDataFactory)12 OWLAnnotationProperty (org.semanticweb.owlapi.model.OWLAnnotationProperty)7 OWLClass (org.semanticweb.owlapi.model.OWLClass)6 OWLObjectProperty (org.semanticweb.owlapi.model.OWLObjectProperty)6 OWLAnnotationAssertionAxiom (org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom)5 OWLClassAssertionAxiom (org.semanticweb.owlapi.model.OWLClassAssertionAxiom)5 OWLDataProperty (org.semanticweb.owlapi.model.OWLDataProperty)5 OWLDataPropertyAssertionAxiom (org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom)5 OWLNamedIndividual (org.semanticweb.owlapi.model.OWLNamedIndividual)5 OWLObjectPropertyAssertionAxiom (org.semanticweb.owlapi.model.OWLObjectPropertyAssertionAxiom)5 IRI (org.semanticweb.owlapi.model.IRI)4 OWLAnnotation (org.semanticweb.owlapi.model.OWLAnnotation)4 AddAxiom (org.semanticweb.owlapi.model.AddAxiom)3 OWLOntology (org.semanticweb.owlapi.model.OWLOntology)3 OWLOntologyCreationException (org.semanticweb.owlapi.model.OWLOntologyCreationException)3 OWLOntologyManager (org.semanticweb.owlapi.model.OWLOntologyManager)3 Statement (com.hp.hpl.jena.rdf.model.Statement)2 StmtIterator (com.hp.hpl.jena.rdf.model.StmtIterator)2 OWLDatatype (org.semanticweb.owlapi.model.OWLDatatype)2