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

Examples of com.hp.hpl.jena.rdf.model.Resource.listProperties()


                    + aggregated + " from feed at " + feedURL);
            // remove dc:date and rss:image and its target properties
            Resource existingChannel = (Resource) aggregated.inModel(model);
            JenaUtil.deepRemoveProperties(existingChannel);
            existingChannel.removeAll(DC.date);
            StmtIterator images = existingChannel.listProperties(RSS.image);
            while (images.hasNext()) {
                Statement currentImageStmt = images.nextStatement();
                currentImageStmt.getResource().removeProperties();
            }
            images.close();
View Full Code Here


      if (current.hasProperty(RDF.type,
          AUTHORIZATION.PermissionAlternatives)) {
        Resource original = current;
        current = model
            .createResource(AUTHORIZATION.PermissionAlternatives);
        StmtIterator alternativeIter = original.listProperties();
        int i = 0;
        while (alternativeIter.hasNext()) {
          Statement alternativeStmt = alternativeIter.nextStatement();
          if (alternativeStmt.getPredicate().getOrdinal() > 0) {
            i++;
View Full Code Here

      Statement targetStmt = targetStmtIter.nextStatement();
      Resource target = targetStmt.getResource();
      Statement mboxStmt = target.getProperty(FOAF.mbox);
      if (mboxStmt == null) {
        log.warn("Found no mbox to notify agent with properties: ");
        StmtIterator allProperties = target.listProperties();
        while (allProperties.hasNext()) {
          log.warn(allProperties.nextStatement());
        }
        continue;
      }
View Full Code Here

          Relation relation = iter.nextRelation();//topicsList.getRelation(i);
          resultModel.add(JenaUtil.getExpandedResource(relation
              .getResource(), 2));
          Resource source = relation.getSource();
          if (source.hasProperty(RSS.title)) {
              StmtIterator titles =  source.listProperties(RSS.title);
              while (titles.hasNext()) {
                  resultModel.add(titles.nextStatement());
              }
          }
          if (relation.getStrength() < minimalRelevance) {
View Full Code Here

   * @param extraPath
   * @return
   */
  protected HttpResource[] getResources(URL url) {
    Resource requestResource = model.createResource(url.toString());
    StmtIterator variantIter = requestResource
    .listProperties(DOCUMENT.variant);
    Map varMap = new HashMap();
    while (variantIter.hasNext()) {
      HttpResource httpResource = new DocVariantHttpResource(hashStore, variantIter.nextStatement().getResource());
      VariantDescriptor variantDescriptor = new VariantDescriptor(httpResource.getMimeType(), httpResource.getLocale());
View Full Code Here

          .inModel(model);
      if (existingAgentDoc.hasProperty(FOAF.primaryTopic)) {
        Resource existingAgent = existingAgentDoc.getProperty(
            FOAF.primaryTopic).getResource();
        existingAgentDoc.removeProperties();
        StmtIterator mboxes = existingAgent.listProperties(FOAF.mbox);
        while (mboxes.hasNext()) {
          Statement current = mboxes.nextStatement();
          current.getResource().removeProperties();
        }
        mboxes.close();
View Full Code Here

   */
  private static void makeDescriptionDocuments(Model model,Model importing, URL baseURL) {
    ResIterator agents = importing.listSubjectsWithProperty(RDF.type, FOAF.Agent);
    while (agents.hasNext()) {
      Resource current = (Resource) agents.nextResource().inModel(model);
      StmtIterator documents = current.listProperties(FOAF.isPrimaryTopicOf);
      boolean authoritativeFound = false;
      while (documents.hasNext()) {
        Resource currentDoc = documents.nextStatement().getResource();
        if (currentDoc.hasProperty(RDF.type, RWCF.AuthoritativelyServedResource)) {
          authoritativeFound = true;
View Full Code Here

       String resourceString = body.getParameter("resource");
       String languageString = body.getParameter("language");
       Resource resource = model.createResource(resourceString);
       model.createStatement(resource, DC.language, languageString).remove();
       Collection deletingProperties = new ArrayList();
       StmtIterator properties = resource.listProperties();
       while (properties.hasNext()) {
           Statement current = properties.nextStatement();
           RDFNode object = current.getObject();
           if ((object instanceof Literal) && (languageString.equals(((Literal)object).getLanguage()))) {
               deletingProperties.add(current);
View Full Code Here

       Resource item = model.createResource(itemString);
       Resource subject = VirtuserHandler.getSubject();
       if (!model.containsResource(subject) || subject.hasProperty(RDF.type, TEMPSUBJECT.TemporarySubject)) {
           throw new AccessControlException("no nots for temps");
       }
       StmtIterator allProperties = subject.listProperties();
       try {
           if (!allProperties.hasNext()) {
               throw new AccessControlException("no nots for temps");
           }
       } finally {
View Full Code Here

    while (paperIt.hasNext()) {
      Resource paper = paperIt.nextStatement().getSubject();
      System.out.println("Paper: " + paper.getProperty(DC.title).getString());
     
      // List authors of the paper and print their names
      StmtIterator authorIt = paper.listProperties(DC.creator);
      while (authorIt.hasNext()) {
        Resource author = authorIt.nextStatement().getResource();
        System.out.println("Author: " + author.getProperty(FOAF.name).getString());
      }
      System.out.println();
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.