Examples of listStatements()


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

Examples of com.hp.hpl.jena.rdf.model.InfModel.listStatements()

     

    String rules = SYM_RULE;
    Reasoner ruleReasoner = new GenericRuleReasoner(Rule.parseRules(rules));
    InfModel inf = ModelFactory.createInfModel(ruleReasoner, model);
    for ( Statement stmt : inf.listStatements().toList() ) {
      log.debug("^^ " +stmt);
    }
  }

  private static void _characterizeSkosRelations(Model model) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listStatements()

  public void start() {
    int previousTrustedSourceSize = 0;
    while (trustedSources.size() > previousTrustedSourceSize) {
      previousTrustedSourceSize = trustedSources.size();
      Model currentModel = ModelFactory.createModelForGraph(store.getGraphOverTime(trustedSources).getGraph(new Date()));
      StmtIterator seeAlsoStmt = currentModel.listStatements(null, RDFS.seeAlso, (Resource)null);
      while(seeAlsoStmt.hasNext()) {
        Statement stmt = seeAlsoStmt.nextStatement();
        RDFNode object = stmt.getObject();
        try {
          Source seeAlsoSource = new SourceImpl(((Resource)object).getURI());
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listStatements()

    static public void main(String...argv)
    {
        Store store = StoreFactory.create("sdb.ttl") ;
        Model model = SDBFactory.connectDefaultModel(store) ;
       
        StmtIterator sIter = model.listStatements() ;
        for ( ; sIter.hasNext() ; )
        {
            Statement stmt = sIter.nextStatement() ;
            System.out.println(stmt) ;
        }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listStatements()

      return wrapped.listPropertyValues(resourceIRI, property, isInverse);
    }
    Model all = describeResource(resourceIRI);
    Resource r = all.getResource(resourceIRI);
    StmtIterator it = isInverse
        ? all.listStatements(null, property, r)
        : all.listStatements(r, property, (RDFNode) null);
    Model result = ModelFactory.createDefaultModel();
    while (it.hasNext()) {
      result.add(it.next());
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listStatements()

    }
    Model all = describeResource(resourceIRI);
    Resource r = all.getResource(resourceIRI);
    StmtIterator it = isInverse
        ? all.listStatements(null, property, r)
        : all.listStatements(r, property, (RDFNode) null);
    Model result = ModelFactory.createDefaultModel();
    while (it.hasNext()) {
      result.add(it.next());
    }
    return result;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listStatements()

    public Collection<Property> get() {
      if (dataSource == null) return Collections.emptyList();
      if (cache != null) return cache;
      cache = new ArrayList<Property>();
      Model result = dataSource.listPropertyValues(type.getURI(), RDF.type, true);
      StmtIterator it = result.listStatements(null, RDF.type, type);
      while (it.hasNext()) {
        Resource r = it.next().getSubject();
        if (!r.isURIResource()) continue;
        cache.add(r.as(Property.class));
      }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listStatements()

   
    // remove blank nodes that don't have any properties
    boolean changes = true;
    while ( changes ) {
      changes = false;
      StmtIterator stmtIt = metadata.listStatements();
      List<Statement> remList = new ArrayList<Statement>();
      while (stmtIt.hasNext()) {
        Statement s = stmtIt.nextStatement();
        if (    s.getObject().isAnon()
             && ! ((Resource) s.getObject().as(Resource.class)).listProperties().hasNext() ) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.listStatements()

      model = _getGraphsModel();
    }
    if ( model == null ) {
      return null;
    }
    return model.listStatements().toList();
  }
 

  /**
   * {@link #init()} does the actual initialization.
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.Model.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 describeMetatada = describeModel.listStatements(ontologyResource, null, (RDFNode) null);
      while ( describeMetatada.hasNext() ) {
        Statement stmt = describeMetatada.nextStatement();
        System.out.println("\t" +stmt.getPredicate()+ " -> " +stmt.getObject());
      }
    }
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.