Codota Logo
Property.asResource
Code IndexAdd Codota to your IDE (free)

How to use
asResource
method
in
org.apache.jena.rdf.model.Property

Best Java code snippets using org.apache.jena.rdf.model.Property.asResource (Showing top 4 results out of 315)

  • Common ways to obtain Property
private void myMethod () {
Property p =
  • Codota IconStatement stmt;stmt.getPredicate()
  • Codota IconString uriref;ResourceFactory.createProperty(uriref)
  • Codota IconModel model;String str;model.createProperty(str)
  • Smart code suggestions by Codota
}
origin: org.fcrepo/fcrepo-http-commons

/**
 * Return an iterator of Triples for versions.
 *
 * @param graph the graph
 * @param subject the subject
 * @return iterator
 */
public Iterator<Node> getVersions(final Graph graph,
  final Node subject) {
  // Mementos should be ordered by date so use the getOrderedVersions.
  return getOrderedVersions(graph, subject, CONTAINS.asResource());
}
origin: SmartDataAnalytics/jena-sparql-api

public static void createQueryBackward(Model model, Node node, Resource res, Set<Triple> result) {
  Node n;
  if(node.isVariable()) {
    n = createVarUri((Var)node);
  } else {
    n = node;
  }
  Resource r = model.asRDFNode(n).asResource();
  Set<Statement> preds = model.listStatements(null, null, r).toSet();
  for(Statement stmt : preds) {
    Resource s = stmt.getSubject();
    Property p = stmt.getPredicate();
    //Triple t = new Triple(p.asNode(), VocabPath.joinsWith.asNode(), node);
    Triple t = new Triple(node, VocabPath.joinsWith.asNode(), p.asNode());
    if(!result.contains(t)) {
      result.add(t);
      createQueryBackward(model, s.asNode(), p.asResource(), result);
    }
  }
}
origin: SmartDataAnalytics/jena-sparql-api

public static void createQueryForward(Model model, Node node, Resource res, Set<Triple> result) {
  Node n;
  if(node.isVariable()) {
    n = createVarUri((Var)node);
  } else {
    n = node;
  }
  Resource r = model.asRDFNode(n).asResource();
  Set<Statement> succs = model.listStatements(r, null, (RDFNode)null).toSet();
  for(Statement stmt : succs) {
    RDFNode oo = stmt.getObject();
    if(!oo.isURIResource()) {
      continue;
    }
    Property p = stmt.getPredicate();
    Resource o = oo.asResource();
    Triple t = new Triple(node, VocabPath.joinsWith.asNode(), p.asNode());
    if(!result.contains(t)) {
      result.add(t);
      createQueryForward(model, o.asNode(), p.asResource(), result);
    }
  }
}
origin: at.researchstudio.sat/won-cryptography

private static GraphCollection modelToGraphCollection(String name, Model model, Map<String, String> pm) {
 // Convert each subj pred obj in Jena Statement into String and add to
 // SigningFramework's NamedGraph.
 //The simpler approach with just using Jena's writer and Signingframework's
 //reader to transform data between data structures won't work since
 //Signingframework has problems with recognizing the [] structure
 GraphCollection graphc = new GraphCollection();
 NamedGraph namedGraph = new NamedGraph(enclose(name, "<", ">"), 0, null);
 StmtIterator iterator = model.listStatements();
 while (iterator.hasNext()) {
  Statement stmt = iterator.nextStatement();
  String subjString = rdfNodeAsString(stmt.getSubject());
  String objString = rdfNodeAsString(stmt.getObject());
  String predString = enclose(stmt.getPredicate().asResource().getURI(), "<", ">");
  Triple gcTriple = new Triple(subjString, predString, objString);
  namedGraph.addTriple(gcTriple);
 }
 graphc.addGraph(namedGraph);
 for (String prefix : pm.keySet()) {
  graphc.addPrefix(new Prefix(prefix + ":", "<" + pm.get(prefix) + ">"));
 }
 // don't apply prefixes since it can result in funny things like:
 // pref:/connections/, and also the collision on the prefix uris
 // that starts the same. E.g. having prefixes below in need rdf
 // would cause errors
 // @prefix :    <http://www.example.com/resource/need/12#> .
 // @prefix need:    <http://www.example.com/resource/need/12> .
 //graphc.applyPrefixes();
 return graphc;
}
org.apache.jena.rdf.modelPropertyasResource

Popular methods of Property

  • asNode
  • getURI
  • getLocalName
    Returns the name of this property within its namespace.
  • getNameSpace
    Returns the namespace associated with this property.
  • as
  • getModel
  • addProperty
  • getOrdinal
    Returns the ordinal value of a containment property.RDF containers use properties of the form _1, _2
  • canAs
  • inModel
  • isAnon
  • removeAll
  • isAnon,
  • removeAll

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • putExtra (Intent)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • JButton (javax.swing)
  • Join (org.hibernate.mapping)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.This exception may include information for locating the er
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now