Examples of nextResource()


Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

    Model serviceConfigModel = JenaUtil.getModelFromGraph(serviceConfig);
    serviceConfigModel.write(System.out);
    ResIterator servicesIter = serviceConfigModel.listSubjectsWithProperty(RDF.type, SERVICES.Service);
    while (servicesIter.hasNext()) {
      try {
        launchService(store, servicesIter.nextResource());
      } catch (Exception e) {
        log.error("Error launching service", e);
      }
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

    ResIterator subjectIter = model.listSubjectsWithProperty(
        ACCOUNTMANAGER.userName, username);
    if (!subjectIter.hasNext()) {
      return null;
    }
    Resource subject = subjectIter.nextResource();
    if (subjectIter.hasNext()) {
      throw new RuntimeException("Username ambiguos");
    }
    return subject;
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

    ResIterator subjectIter = model.listSubjectsWithProperty(
        ACCOUNTMANAGER.userName, username);
    if (!subjectIter.hasNext()) {
      return null;
    }
    Resource subject = subjectIter.nextResource();
    if (subjectIter.hasNext()) {
      throw new RuntimeException("Username ambiguos");
    }
    return subject;
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

    Model logModel = JenaUtil.getModelFromGraph(currentLog);
    Set<Source> result = new HashSet<Source>();
    ResIterator sourceIter = configurationModel.listSubjectsWithProperty(
        RDF.type, AGGREGATOR.AggregatedSource);
    while (sourceIter.hasNext()) {
      Resource aggregatedSource = sourceIter.nextResource();
      Date lastAggregation = getLastAggregationDate((Resource) aggregatedSource
          .inModel(logModel));
      if (lastAggregation == null) {
        result.add(new SourceImpl(aggregatedSource.getURI()));
      } else {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

    Model model = aggregatedSource.getModel();
    ResIterator downloadAttempts = model
        .listSubjectsWithProperty(AGGREGATOR.aggregatedSource, aggregatedSource);
    Date result = null;
    while (downloadAttempts.hasNext()) {
      Resource downloadAtttempt = downloadAttempts.nextResource();
      Date time;
      try {
        time = new W3CDateFormat().parse(downloadAtttempt.getProperty(
            AGGREGATOR.time).getString());
      } catch (ParseException e) {
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

      Model sourcesModel = ModelFactory.createDefaultModel();
      sourcesModel.read(sourcesURL.toString());
      ResIterator sourcesIter = sourcesModel.listSubjectsWithProperty(
          RDF.type, METAMODEL.Source);
      while (sourcesIter.hasNext()) {
        result.add(sourcesIter.nextResource().getURI());
      }
    } catch (MalformedURLException e) {
      throw new RuntimeException(e);
    }
    return result;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

      private void addURIsForType(Model model, OntClass type) {
        ResIterator subjectIter = model.listSubjectsWithProperty(
            RDF.type, type);
        // model.write(System.out);
        while (subjectIter.hasNext()) {
          Resource infoDiscoResource = subjectIter.nextResource();
          RDFNode infoBitNode = infoDiscoResource.getProperty(
              DISCOBITS.infoBit).getObject();
          if (infoBitNode instanceof Literal) {
            final Literal literaInfoBit = (Literal) infoBitNode;
            infoDiscoBitURIs.put(infoDiscoResource.getURI(),
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

  private Resource getSubject(Property property, RDFNode object)
  {
    ResIterator found = config.listSubjectsWithProperty(property, object);
    if (!found.hasNext())
      return null;
    Resource foundSubject = found.nextResource();
    found.close();
    return foundSubject;
  }

  private Resource getObjectType(Node predicate)
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

    ResIterator ri = configModel.listSubjectsWithProperty(RDF.type, DbMap.Map);
   
    if (!ri.hasNext())
      throw new ConfigException("No map in config file");
   
    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())
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.ResIterator.nextResource()

    Table table = new Table(aClass, database);
    class2table.put(aClass, table);
    ResIterator ri = aClass.getModel().listSubjectsWithProperty(RDFS.domain, aClass);
    while (ri.hasNext())
    {
      Resource prop = ri.nextResource();
      Col col = new Col(prop, table);
      prop2col.put(prop, col);
    }
    StmtIterator si = aClass.listProperties(DbMap.primaryKey);
    while (si.hasNext())
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.