Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLNamedIndividual


                    OWLIndividual tmp=sub;
                    sub=obj;
                    obj=tmp;
                    ope=ope.getInverseProperty().getSimplified();
                }
                OWLNamedIndividual named=obj.asOWLNamedIndividual();
                OWLAnonymousIndividual unnamed=sub.asOWLAnonymousIndividual();
                namedNodes.add(named);
                nodes.add(unnamed);
                if (specialOPEdges.containsKey(unnamed)) {
                    Map<OWLNamedIndividual,Set<OWLObjectPropertyExpression>> specialEdges=specialOPEdges.get(unnamed);
View Full Code Here


   
    // get all instances of Person class
    NodeSet<OWLNamedIndividual> individuals = reasoner.getInstances( Person, false);
    for(Node<OWLNamedIndividual> sameInd : individuals) {
      // sameInd contains information about the individual (and all other individuals that were inferred to be the same)
      OWLNamedIndividual ind =  sameInd.getRepresentativeElement();
     
        // get the info about this specific individual
      Set<OWLLiteral> names = reasoner.getDataPropertyValues( ind, foafName );                       
        NodeSet<OWLClass> types = reasoner.getTypes( ind, true );       
        NodeSet<OWLNamedIndividual> homepages = reasoner.getObjectPropertyValues( ind, workHomepage );
View Full Code Here

    long e = System.currentTimeMillis();
    System.out.println( "Consistent? " + consistent + " (" + (e - s) + "ms)" );

    // peform ABox addition which results in a consistent KB
    OWLClass concept = factory.getOWLClass( IRI.create( mindswap + "GraduateStudent" ) );
    OWLNamedIndividual individual = factory
        .getOWLNamedIndividual( IRI.create( mindswappers + "JohnDoe" ) );
    manager.applyChange( new AddAxiom( ontology, factory.getOWLClassAssertionAxiom( concept, individual ) ) );

    // perform incremental consistency check
    s = System.currentTimeMillis();
    consistent = reasoner.isConsistent();
    e = System.currentTimeMillis();
    System.out.println( "Consistent? " + consistent + " (" + (e - s) + "ms)" );

    // peform ABox addition which results in an inconsistent KB
    OWLObjectProperty role = factory.getOWLObjectProperty( IRI.create( foaf + "mbox" ) );
    individual = factory.getOWLNamedIndividual( IRI.create( mindswappers + "Christian.Halaschek" ) );
    OWLNamedIndividual mbox = factory.getOWLNamedIndividual( IRI.create( "mailto:kolovski@cs.umd.edu" ) );
    manager.applyChange( new AddAxiom( ontology, factory.getOWLObjectPropertyAssertionAxiom(
        role, individual, mbox ) ) );

    // perform incremental consistency check
    s = System.currentTimeMillis();
View Full Code Here

        .toArray(new String[] {});
    for (int i = 0; i < keys.length; i++) {
      Object[] val = (Object[]) urisandvals.get(keys[i]);
      for (int y = 0; y < val.length; y++) {

        OWLNamedIndividual annind = factory.getOWLNamedIndividual(IRI.create(keys[i]));
        Set<OWLAnnotation> anns = annind.getAnnotations(ontology, label);
        for (OWLAnnotation ann : anns) {
          OWLAxiom removeax = factory.getOWLAnnotationAssertionAxiom(
              (OWLAnnotationSubject) annind, ann);
          manager.applyChange(new RemoveAxiom(ontology, removeax));
        }
        String[] array = (String[]) urisandvals.get(keys[i]);
        OWLAnnotation newann = factory.getOWLAnnotation(factory
            .getOWLAnnotationProperty(OWLRDFVocabulary.RDFS_LABEL
                .getIRI()), factory.getOWLStringLiteral(
            array[0], "en"));
        OWLAxiom ax = factory.getOWLAnnotationAssertionAxiom(
            annind.getIRI(), newann);
        manager.applyChange(new AddAxiom(ontology, ax));
//        SBMLreactionCollector.logfilewriter.println("RDF label for " + keys[i] + ": "
//            + array[0]);
      }
    }
View Full Code Here

        // assertEquals("file", o.getOWLOntologyManager().getOntologyDocumentIRI(o).getScheme());

        assertEquals(coreSource.getRootOntology().getOntologyID().getOntologyIRI(),
            IRI.create(Constants.PEANUTS_MAIN_BASE));
        // Linus is stated to be a foaf:Person
        OWLNamedIndividual iLinus = df.getOWLNamedIndividual(IRI.create(Constants.PEANUTS_MAIN_BASE
                                                                        + "#Linus"));
        // Lucy is stated to be a foaf:Perzon
        OWLNamedIndividual iLucy = df
                .getOWLNamedIndividual(IRI.create(Constants.PEANUTS_MAIN_BASE + "#Lucy"));
        OWLClass cPerzon = df.getOWLClass(IRI.create("http://xmlns.com/foaf/0.1/Perzon"));

        Set<OWLIndividual> instances = cPerzon.getIndividuals(coreSource.getRootOntology());
        assertTrue(!instances.contains(iLinus) && instances.contains(iLucy));
View Full Code Here

            log.error(e.getMessage());
        }

        if (ontology != null) {
            OWLClass personClass = factory.getOWLClass(IRI.create(foaf + "Person"));
            OWLNamedIndividual andreaNuzzoleseOWL = factory.getOWLNamedIndividual(IRI
                    .create(ns + "AndreaNuzzolese"));
            OWLNamedIndividual enricoDagaOWL = factory.getOWLNamedIndividual(IRI.create(ns + "EnricoDaga"));
            OWLObjectProperty knowsOWL = factory.getOWLObjectProperty(IRI.create(foaf + "knows"));

            OWLAxiom axiom = factory.getOWLClassAssertionAxiom(personClass, andreaNuzzoleseOWL);
            manager.addAxiom(ontology, axiom);
View Full Code Here

        OWLDataProperty dp = factory.getOWLDataProperty(IRI.create(DP));
        OWLObjectProperty op = factory.getOWLObjectProperty(IRI.create(OP));
        OWLAnnotationProperty oa = factory.getOWLAnnotationProperty(IRI.create(label));
        OWLAnnotation oav = factory.getOWLAnnotation(oa, factory.getOWLStringLiteral(clazzlabel, "en"));
        OWLDatatype dt = factory.getOWLDatatype(IRI.create(DATATYPE));
        OWLNamedIndividual sub = factory.getOWLNamedIndividual(IRI.create(SUBJECT));
        OWLNamedIndividual obj = factory.getOWLNamedIndividual(IRI.create(OBJECT));
        OWLLiteral literal1 = factory.getOWLTypedLiteral(VALUE, dt);
        OWLDeclarationAxiom daxiomcls = factory.getOWLDeclarationAxiom(cls); // Classe
        OWLDeclarationAxiom daxiomop = factory.getOWLDeclarationAxiom(op); // obj prop
        OWLDeclarationAxiom daxiomdp = factory.getOWLDeclarationAxiom(dp); // data prop
        OWLDeclarationAxiom daxiomsub = factory.getOWLDeclarationAxiom(sub); // subject
View Full Code Here

        OWLDataProperty dp = factory.getOWLDataProperty(IRI.create(DP));
        OWLObjectProperty op = factory.getOWLObjectProperty(IRI.create(OP));
        OWLAnnotationProperty oa = factory.getOWLAnnotationProperty(IRI.create(label));
        OWLAnnotation oav = factory.getOWLAnnotation(oa, factory.getOWLStringLiteral(clazzlabel, "en"));
        OWLDatatype dt = factory.getOWLDatatype(IRI.create(DATATYPE));
        OWLNamedIndividual sub = factory.getOWLNamedIndividual(IRI.create(SUBJECT));
        OWLNamedIndividual obj = factory.getOWLNamedIndividual(IRI.create(OBJECT));
        OWLLiteral literal1 = factory.getOWLTypedLiteral(VALUE, dt);
        OWLDeclarationAxiom daxiomcls = factory.getOWLDeclarationAxiom(cls); // Classe
        OWLDeclarationAxiom daxiomop = factory.getOWLDeclarationAxiom(op); // obj prop
        OWLDeclarationAxiom daxiomdp = factory.getOWLDeclarationAxiom(dp); // data prop
        OWLDeclarationAxiom daxiomsub = factory.getOWLDeclarationAxiom(sub); // subject
View Full Code Here

        // The ODP metadata vocabulary is always imported.
        // TODO : also import the ONM meta when it goes online.
        additions.add(new AddImport(ont, __factory.getOWLImportsDeclaration(IRI
                .create("http://www.ontologydesignpatterns.org/schemas/meta.owl"))));
        for (Scope scope : scopes) {
            OWLNamedIndividual iScope = __factory.getOWLNamedIndividual(IRI.create(scope
                    .getDefaultNamespace() + scope.getID()));
            OWLAxiom ax = __factory.getOWLClassAssertionAxiom(cScope, iScope);
            additions.add(new AddAxiom(ont, ax));
        }
        mgr.applyChanges(additions);
View Full Code Here

        try {
            o = ontMgr.createOntology(IRI.create(uriInfo.getRequestUri()));
            List<OWLOntologyChange> changes = new ArrayList<OWLOntologyChange>();
            for (String id : sessionManager.getRegisteredSessionIDs()) {
                IRI sessionid = IRI.create(sessionManager.getDefaultNamespace() + sessionManager.getID() + "/" + id);
                OWLNamedIndividual ind = df.getOWLNamedIndividual(sessionid);
                changes.add(new AddAxiom(o, df.getOWLClassAssertionAxiom(cSession, ind)));
            }
            ontMgr.applyChanges(changes);
        } catch (OWLOntologyCreationException e) {
            throw new WebApplicationException(e, INTERNAL_SERVER_ERROR);
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLNamedIndividual

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.