Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntModel.listStatements()


   
    // the following shows the metadata ie. properties with vocabularyUri as subject:
    // false: not included to avoid cluttering the test output
    if ( false ) {
      Resource ontologyResource = ResourceFactory.createResource(vocabularyUri);
      StmtIterator metadata = model.listStatements(ontologyResource, null, (RDFNode) null);
      while ( metadata.hasNext() ) {
        Statement stmt = metadata.nextStatement();
        System.out.println("\t" +stmt.getPredicate()+ " -> " +stmt.getObject());
      }
    }
View Full Code Here


            throw new SearchException(String.format("MGraph having URI %s could obtained through TcManager",
                userOntologyURI));
        }
        this.userOntology = userGraph;
        this.userGraphIndexBuilder = new IndexBuilderString(IndexingHelper.HAS_LOCAL_NAME);
        this.userGraphIndexBuilder.indexStatements(userGraph.listStatements());
        // Do not forget to set the default index just before the query execution according to its context
        // LARQ.setDefaultIndex(index);
    }

    private void processClassResultSet(ResultSet result, String keyword, List<RelatedKeyword> relatedKeywords) {
View Full Code Here

            owlaxiom = j2o.ResourceJenaToOwlAxiom(jenasub, RDFXML);
            if (owlaxiom == null) {
                fail("Some errors occur");
            } else {

                StmtIterator str = model.listStatements();

                int count = 0;
                while (str.hasNext()) {
                    Statement stm = str.next();
                    Resource subject = stm.getSubject();
View Full Code Here

                }

            };
        } else if (type.isAssignableFrom(Statement.class)) {
            final OntModel input = new JenaToOwlConvert().ModelOwlToJenaConvert(o, "RDF/XML");
            final StmtIterator iterator = input.listStatements();
            return new Iterator<T>() {

                @Override
                public boolean hasNext() {
                    return iterator.hasNext();
View Full Code Here

            synchronized (url) {
                  // FIXME: use instead:
                  // FileManager.get().loadModel
                  input.read(url);
            }
            final StmtIterator iterator = input.listStatements();
            return new Iterator<T>(){
               
                @Override
                public boolean hasNext() {
                    return iterator.hasNext();
View Full Code Here

            OntModel jenamodel = ModelOwlToJenaConvert(ontology, format);

            available = true;
            notifyAll();
            return jenamodel.listStatements();
        } catch (OWLOntologyCreationException eoc) {
            System.err.print("AxiomOwlToJenaResource::: ");
            eoc.printStackTrace();
            return null;
        }
View Full Code Here

                while (annotations.hasNext())
                    manager.addAxiom(ontology, annotations.next());
            }

            OntModel ontmodel = ModelOwlToJenaConvert(ontology, format);
            StmtIterator statement = ontmodel.listStatements();

            available = true;
            notifyAll();
            return statement;
        } catch (OWLOntologyCreationException eoc) {
View Full Code Here

                    data.createStatement(c1, RDFS.subClassOf, c3),
                    data.createStatement(c1, RDFS.subClassOf, c1)
                });
       
        OntModel om = ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM_RDFS_INF, data);
        TestUtil.assertIteratorValues(this, om.listStatements(c1, RDFS.subClassOf, null, premise),
                new Object[] {
                    data.createStatement(c1, RDFS.subClassOf, c2),
                    data.createStatement(c1, RDFS.subClassOf, c3),
                    data.createStatement(c1, RDFS.subClassOf, c1)
                });
View Full Code Here

                    data.createStatement(c1, RDFS.subClassOf, c3),
                    data.createStatement(c1, RDFS.subClassOf, c1)
                });
       
        OntModel om = ModelFactory.createOntologyModel(OntModelSpec.RDFS_MEM_RDFS_INF, data);
        TestUtil.assertIteratorValues(this, om.listStatements(c1, RDFS.subClassOf, null, premise),
                new Object[] {
                    data.createStatement(c1, RDFS.subClassOf, c2),
                    data.createStatement(c1, RDFS.subClassOf, c3),
                    data.createStatement(c1, RDFS.subClassOf, c1)
                });
View Full Code Here

    m.add(c, OWL.sameAs, a);
    m.add(A, RDFS.subClassOf, B);
   
    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, m );
 
    assertIteratorValues( model.listStatements(a, null, (RDFNode) null), stmts );
   
    ((PelletInfGraph) model.getGraph()).setSkipBuiltinPredicates(true);
   
    assertIteratorValues( model.listStatements(a, null, (RDFNode) null), stmts[0], stmts[1], stmts[2] );   
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.