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

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


            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

   * @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

    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

  }

  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

   *
   */
  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

        .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

        "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

    } else {
      String serializedModel = body.getParameter("model");
      Model importing = ModelFactory.createDefaultModel();
      importing.read(new StringReader(serializedModel), ehRequest
          .getRequestURLWithoutParams().toString(), "RDF/XML")
      ResIterator importCriterionIter = importing.listSubjectsWithProperty(RDF.type, MAILPUSH.MailingList);
      while (importCriterionIter.hasNext()) {
        importCriterion(importCriterionIter.nextResource(), importing);
      }
      importCriterionIter.close();
    }
View Full Code Here

    Resource nextRelation = null;
    if (nextStmt != null) {
      nextRelation = nextStmt.getResource();
      nextStmt.remove();
    }
    ResIterator previousStmtIter = model.listSubjectsWithProperty(
        KNOBOT.nextRelation, relation);
    if (previousStmtIter.hasNext()) {
      Resource previous = previousStmtIter.nextResource();
      model.remove(model.createStatement(previous, KNOBOT.nextRelation,
          relation));
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.