Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.StmtIterator


      Resource assertion = resIterator.nextResource();
     
      Resource assertedComponent = assertion.getProperty(
          METAMODEL.assertedComponent).getResource();
      Resource type = null;
      StmtIterator typeIter = assertedComponent.listProperties(RDF.type);
      while (typeIter.hasNext()) {
        Resource currentType = typeIter.nextStatement().getResource();
        if (currentType.getNameSpace().equals(METAMODEL.getURI())) {
          type = currentType;
          break;
        }
      }
View Full Code Here


          result.add(new GVSImpersonatePermission());
          result.add(new GVSSetClockPermission());
        }
        Resource userRes = getUserResource(principal.getUserName());
        if (userRes.hasProperty(RDF.type, AUTHORIZATION.ClockMaster));
        StmtIterator impersonateStmt = userRes.listProperties(AUTHORIZATION.mayImpersonate);
        while (impersonateStmt.hasNext()) {
          result.add(new GVSImpersonatePermission(new SourceImpl(impersonateStmt.nextStatement().getResource().toString())));
        }
      }
     
    //}
    return result;
View Full Code Here

  /**
   * @return
   */
  private Set<Source> readSourcesFromMetaModel() {
    Set<Source> result = new HashSet<Source>();
    StmtIterator stmtIterator = metaModel.listStatements(null,
        METAMODEL.asserter, (Resource) null);
    while (stmtIterator.hasNext()) {
      result.add(new SourceImpl(stmtIterator.nextStatement()
          .getResource().getURI()));
    }
    return result;
  }
View Full Code Here

      if (groundingMolecules == null) {
        final List<NonTerminalMolecule> resultList = new ArrayList<NonTerminalMolecule>();
        synchronized (this) {
          if (groundingMolecules == null) {

            StmtIterator containsStmts = resource
                .listProperties(METAMODEL.containsNonTerminalMolecule);
            while (containsStmts.hasNext()) {
              Resource ntMolRes = containsStmts.nextStatement()
                  .getResource();
              resultList.add(new FSNTMolecule(ntMolRes));
            }
            groundingMolecules = new AbstractSet<NonTerminalMolecule>() {
View Full Code Here

   * @param serviceResource
   * @return
   */
  private Set<Source> getTrustedSources(Resource serviceResource) {
    Set<Source> result = new HashSet<Source>();
    StmtIterator trustProrpertyStmts = serviceResource.listProperties(SERVICES.trustedSource);
    while (trustProrpertyStmts.hasNext()) {
      Statement propertyStmt = trustProrpertyStmts.nextStatement();
      result.add(new SourceImpl(propertyStmt.getResource().getURI()));
    }
    return result;
  }
View Full Code Here

  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());
          if (trustedSources.contains(seeAlsoSource)) {
            continue;
View Full Code Here

    Context ctx = new Context(new URI(resource.getURI()), xmlns, resource.getModel(),schemaMap,this);
   
    if (ctx.toXML(doc, resource)) return doc;

    GlozeURL.logger.warn("drop: no schema mapping for resource: "+resource);
    StmtIterator si = resource.listProperties();
    if (!si.hasNext())
      GlozeURL.logger.warn("because no properties, is gloze.uri correctly defined?");
    else while (si.hasNext()) {
      Property p = si.nextStatement().getPredicate();
      // skip eg. RDF:type
      if (p.getNameSpace().equals(RDF.getURI())) continue;
      GlozeURL.logger.warn("because no matching property: "+p.getURI());
    }
    // try no-schema mapping
View Full Code Here

   
    this.map = ri.nextResource();
    if (ri.hasNext())
      log.warn("There is more than one map in the config file");
   
    StmtIterator si = map.listProperties(DbMap.mapsClass);
    while (si.hasNext())
    {
      Resource aClass = si.nextStatement().getResource();
      initFromClass(aClass);
   
    si.close();
    si = configModel.listStatements(null, DbMap.foreignKey, (RDFNode) null);
    while (si.hasNext())
    {
      Statement s = si.nextStatement();
      Col subj = prop2col.get(s.getSubject());
      Col obj = prop2col.get(s.getObject());
      if (subj == null || obj == null)
        log.warn("Foreign key missed: " + s);
      subj.setForeignKey(obj);
View Full Code Here

    {
      Resource prop = ri.nextResource();
      Col col = new Col(prop, table);
      prop2col.put(prop, col);
    }
    StmtIterator si = aClass.listProperties(DbMap.primaryKey);
    while (si.hasNext())
    {
      Resource primKey = si.nextStatement().getResource();
      Col primCol = prop2col.get(primKey);
      if (primCol == null)
        throw new ConfigException("Primary key unknown: " + primKey);
      else
        primCol.setIsPrimaryKey(true);
View Full Code Here

    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) ;
        }
        sIter.close() ;
        store.close() ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.StmtIterator

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.