Examples of listSubjectsWithProperty()


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

      incoming.read(new StringReader(src), null, "N3");

      // Find the bNode that will be rewritten
      final Property name = incoming.createProperty(
          "http://xmlns.com/foaf/0.1/", "name");
      final ResIterator ri = incoming.listSubjectsWithProperty(name,
          "Ian Dickinson");
      final Resource bNode = ri.nextResource();
      ri.close();

      // Rewrite it to ground form
View Full Code Here

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

    Model model = ModelFactory.createDefaultModel();
    URL url = SecurityExample.class.getClassLoader().getResource(
        "org/apache/jena/security/example/example.ttl");
    model.read(url.toExternalForm());
    ResIterator ri = model.listSubjectsWithProperty(RDF.type, msgType);
    System.out.println("All the messages");
    while (ri.hasNext()) {
      Resource msg = ri.next();
      Statement to = msg.getProperty(pTo);
      Statement from = msg.getProperty(pFrom);
View Full Code Here

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

        "http://example.com/SecuredModel", model);
    for (String userName : names) {
      evaluator.setPrincipal(userName);

      System.out.println("Messages " + userName + " can manipulate");
      ri = model.listSubjectsWithProperty(RDF.type, msgType);
      while (ri.hasNext()) {
        Resource msg = ri.next();
        Statement to = msg.getProperty(pTo);
        Statement from = msg.getProperty(pFrom);
        Statement subj = msg.getProperty(pSubj);
View Full Code Here

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

            from.getObject(), subj.getObject()));
      }
      ri.close();
      for (String name : names)
      {
        System.out.println( String.format( "%s messages to %s", model.listSubjectsWithProperty( pTo, name ).toList().size(), name ) );
      }
      System.out.println();
    }
  }
View Full Code Here

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

   * @param string
   */
  public static void removeVariant(Resource target, String contentURI, String contentType) {
   
    Model model = target.getModel();
    ResIterator contentURIMatching = model.listSubjectsWithProperty(
        DOCUMENT.content, model.createResource(contentURI));
    while (contentURIMatching.hasNext()) {
      Resource current = contentURIMatching.nextResource();
      if (current.hasProperty(DOCUMENT.contentType, contentType)) {
        if (target.hasProperty(DOCUMENT.variant, current)) {
View Full Code Here

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

    Model resultModel = ModelFactory.createDefaultModel();
    // URL test = getClass().getResource("selection.rdf");
    // resultModel.read(getClass().getResourceAsStream("selection.rdf"),
    // "");
    resultModel.read(getClass().getResource("selection.rdf").toString());
    Resource mainFromFile = resultModel.listSubjectsWithProperty(RDF.type,
        RSS.channel).nextResource();
    Resource main = resultModel.createResource(ehRequest.getFullRequestURL().toString());
    JenaUtil.replace(resultModel, mainFromFile, main);

    /*
 
View Full Code Here

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

  }

  public Model getBaseModel() {
    Model bootstrapModel = getBootstrapModel();
    ResIterator baseModelIter = bootstrapModel.listSubjectsWithProperty(
        RDF.type, RWCF.BaseModel);
    Resource baseModelRes = baseModelIter.nextResource();
    if (baseModelIter.hasNext()) {
      throw new RuntimeException(
          "Error in bootstrap-model: multiple BaseModels specified");
View Full Code Here

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

   *
   */
  public InverseDirectRelationIterator(Resource target) {
    Model model = target.getModel();
    SortedSet sortedSet = new TreeSet();
    ResIterator iter = model.listSubjectsWithProperty(KNOBOT.target, target);
    while (iter.hasNext()) {
      sortedSet.add(new ConcreteRelation(iter.nextResource()));
    }
    iter.close();
    baseIter = sortedSet.iterator();
View Full Code Here

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

        .getRequestURLWithoutParams().toString(), "RDF/XML")
    if (codeOrig != null) {
      Resource resOrig = getCountryByCode(codeOrig);
      resOrig.removeProperties();
    }
    ResIterator importCountryIter = importing.listSubjectsWithProperty(RDF.type, POSTADDRESS.Country);
    while (importCountryIter.hasNext()) {
      importCountry(importCountryIter.nextResource());
    }
    importCountryIter.close();
    /*if (uriNew != null) {
View Full Code Here

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

        "timezones/time-zone-data.rdf"), CALENDAR.class.getResource(
        "timezones/time-zone-data.rdf")
        .toString());
    Property offSetProperty = timeZoneData.createProperty("http://www.w3.org/2002/12/cal/icaltzd#tzoffsetto");
    Property standardProperty = timeZoneData.createProperty("http://www.w3.org/2002/12/cal/icaltzd#standard");
    ResIterator zoneIter = timeZoneData.listSubjectsWithProperty(RDF.type,
        timeZoneData.createResource("http://www.w3.org/2002/12/cal/icaltzd#Vtimezone"));
    try {
      while (zoneIter.hasNext()) {
        Resource zone = zoneIter.nextResource();
        Resource standardOffset = zone.getProperty(standardProperty).getResource();
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.