Examples of listSubjectsWithProperty()


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

    Property q = ResourceFactory.createProperty(NS + "q");
    Resource o = ResourceFactory.createResource();
    OntModel pelletModel = ModelFactory.createOntologyModel(PelletReasonerFactory.THE_SPEC);
    pelletModel.add(q,RDFS.subPropertyOf,p);
    pelletModel.add(s,q,o);
    assertEquals(Collections.singletonList(s), pelletModel.listSubjectsWithProperty(p, o).toList());
  }

 
  @Test
  public void test549() {
View Full Code Here

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

    Resource C2 = model.getResource( ns + "76-80" );
   
    Resource i1 = model.getResource( ns + "mark1" );
    Resource i2 = model.getResource( ns + "mark2" );

    assertIteratorValues(model.listSubjectsWithProperty(RDF.type, C1), i1);
    assertIteratorValues(model.listSubjectsWithProperty(RDF.type, C2), i2);
  }

 
  @Test
View Full Code Here

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

   * @return
   */
  private Resource getUserResource(String username) {
    Graph graph  = configGOT.getGraph(new Date());
    Model model = JenaUtil.getModelFromGraph(graph);
    ResIterator resIter = model.listSubjectsWithProperty(ACCOUNTMANAGER.userName, username);
    if (resIter.hasNext()) {
      return resIter.nextResource();
    } else {
      return model.createResource();
    }
View Full Code Here

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

   * @return
   */
  private Resource getUserResource(String username) {
    Graph graph  = configGOT.getGraph(new Date());
    Model model = JenaUtil.getModelFromGraph(graph);
    ResIterator resIter = model.listSubjectsWithProperty(ACCOUNTMANAGER.userName, username);
    if (resIter.hasNext()) {
      return resIter.nextResource();
    } else {
      return null;
    }
View Full Code Here

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

    }
    Graph serviceConfig = store.getGraphOverTime(trustedSources).getGraph(
        new Date());
    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.Model.listSubjectsWithProperty()

   * @return
   */
  private Resource getUserByUsername(String username) {
    Graph graph = configGOT.getGraph(new Date());
    Model model = JenaUtil.getModelFromGraph(graph);
    ResIterator subjectIter = model.listSubjectsWithProperty(
        ACCOUNTMANAGER.userName, username);
    if (!subjectIter.hasNext()) {
      return null;
    }
    Resource subject = subjectIter.nextResource();
View Full Code Here

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

  private Resource getUserByUsernameInIdentityGOT(String username) {
    Graph graph = store.getGraphOverTime(Collections.singleton(identity))
        .getGraph(new Date());
    Model model = JenaUtil.getModelFromGraph(graph);
    ResIterator subjectIter = model.listSubjectsWithProperty(
        ACCOUNTMANAGER.userName, username);
    if (!subjectIter.hasNext()) {
      return null;
    }
    Resource subject = subjectIter.nextResource();
View Full Code Here

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

   * @param node
   * @return the Date of the last AggragationAttempt or null if none exist
   */
  private static Date getLastAggregationDate(Resource aggregatedSource) {
    Model model = aggregatedSource.getModel();
    ResIterator downloadAttempts = model
        .listSubjectsWithProperty(AGGREGATOR.aggregatedSource, aggregatedSource);
    Date result = null;
    while (downloadAttempts.hasNext()) {
      Resource downloadAtttempt = downloadAttempts.nextResource();
      Date time;
View Full Code Here

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

    Set<String> result = new HashSet<String>();
    try {
      URL sourcesURL = new URL(remoteService, "/meta/sources");
      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) {
View Full Code Here

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

          }
        }
      }

      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(
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.