Examples of asResource()


Examples of com.hp.hpl.jena.rdf.model.Literal.asResource()

  {
    final Model m = ModelHelper.modelWithStatements(this, "");
    final Literal l = m.createLiteral("hello, world");
    try
    {
      l.asResource();
      Assert.fail("should not be able to do Literal.asResource()");
    }
    catch (final ResourceRequiredException e)
    {
    }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.RDFNode.asResource()

    }
    NodeIterator objects = model.listObjects();
    while (objects.hasNext() && result.size() < DataSource.MAX_INDEX_SIZE) {
      RDFNode o = objects.next();
      if (!o.isURIResource()) continue;
      result.add(o.asResource());
    }
    return result;
  }
}
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.RDFNode.asResource()

      }
      Property p = result.createProperty(
          rewrite(stmt.getPredicate().getURI()));
      RDFNode o = stmt.getObject();
      if (o.isURIResource()) {
        o = result.createResource(rewrite(o.asResource().getURI()));
      }
      result.add(s, p, o);
    }
    return result;
  }
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.RDFNode.asResource()

      Set<RDFNode> nodes = new HashSet<RDFNode>();
      StmtIterator it = r.listProperties(OWL.inverseOf);
      while (it.hasNext()) {
        RDFNode object = it.next().getObject();
        if (!object.isResource()) continue;
        StmtIterator it2 = object.asResource().listProperties(property);
        while (it2.hasNext()) {
          nodes.add(it2.next().getObject());
        }
      }
      return nodes;
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.RDFNode.asResource()

            System.out.println("  " + resourceName+" class:"+resource.getClass());
            NodeIterator nodes = model.listObjectsOfProperty(resource, RDF.type);
            while(nodes.hasNext()) {
              RDFNode node = nodes.nextNode();
              if(node.isResource()) {
                System.out.println("   type " + node.asResource().getURI());
              }
            }
            StmtIterator stmtI = model.listStatements(resource, null, (RDFNode)null);
            while(stmtI.hasNext()) {
              Statement statement = stmtI.nextStatement();
View Full Code Here

Examples of com.hp.hpl.jena.rdf.model.RDFNode.asResource()

                  Resource onlineAccount = statement.getObject().asResource();                 
                  NodeIterator nodess = model.listObjectsOfProperty(onlineAccount, RDF.type);
                  while(nodess.hasNext()) {
                    RDFNode node = nodess.nextNode();
                    if(node.isResource()) {
                      System.out.println("      type " + node.asResource().getURI());
                    }
                  }
                  for(Property property2 : propertyAccountName) {
                    StmtIterator stmtI2 = model.listStatements(onlineAccount,
                        property2, (RDFNode)null);
View Full Code Here

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

          || uri.startsWith("http://purl.uniprot.org/uniprot#")){
       
        String index = "";
       
        // If the resource has an RDFS:label
        if(labelednodes.contains(rdfnode.asResource())){
          String rdflabel = rdfnode.asResource().getProperty(RDFS.label).getLiteral().toString();
          index = rdflabel + " (" + nsandtlas.get(OWLMethods.getNamespaceFromIRI(uri))[0] + ")";
          urisandlabels.put(uri, rdflabel);
          // Associate instances of this reference resources with RDFS:labels
          for(Statement st : rdfnode.listProperties(normweight).toSet()){
View Full Code Here

Examples of de.danet.an.workflow.spis.ras.ResourceAssignmentService.asResource()

            ResourceAssignmentService ras = getRas();
            if (ras == null) {
                throw new UnsupportedOperationException
                    ("No resource assignment service configured.");
            }
            res = ras.asResource(principal);
        } finally {
            scope.leave (res);
        }
        return res;
    }
View Full Code Here

Examples of models.Attachment.asResource()

            return notFound("The file does not exist.");
        }

        String eTag = "\"" + attachment.hash + "-" + dispositionType + "\"";

        if (!AccessControl.isAllowed(UserApp.currentUser(), attachment.asResource(), Operation.READ)) {
            return forbidden("You have no permission to get the file.");
        }

        response().setHeader("Cache-Control", "private, max-age=3600");
View Full Code Here

Examples of models.CommentThread.asResource()

                break;
            default:
                throw new UnsupportedOperationException();
        }

        if (!AccessControl.isAllowed(UserApp.currentUser(), thread.asResource(), operation)) {
            return forbidden();
        }

        CommentThread.ThreadState previousState = thread.state;
        thread.state = state;
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.