Tabnine Logo
Property.getModel
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: TopQuadrant/shacl

private static void listAllProperties(Resource subject, Property predicate, Set<Property> reached,
    List<Statement> results) {
  reached.add(predicate);
  StmtIterator sit;
  Model model;
  if (subject != null) {
    sit = subject.listProperties(predicate);
    model = subject.getModel();
  }
  else {
    model = predicate.getModel();
    sit = model.listStatements(null, predicate, (RDFNode)null);
  }
  while (sit.hasNext()) {
    results.add(sit.next());
  }
  // Iterate into direct subproperties
  StmtIterator it = model.listStatements(null, RDFS.subPropertyOf, predicate);
  while (it.hasNext()) {
    Statement sps = it.next();
    if (!reached.contains(sps.getSubject())) {
      Property subProperty = asProperty(sps.getSubject());
      listAllProperties(subject, subProperty, reached, results);
    }
  }
}

origin: ch.epfl.bluebrain.nexus.org.topbraid/shacl

private static void listAllProperties(Resource subject, Property predicate, Set<Property> reached,
    List<Statement> results) {
  reached.add(predicate);
  StmtIterator sit;
  Model model;
  if (subject != null) {
    sit = subject.listProperties(predicate);
    model = subject.getModel();
  }
  else {
    model = predicate.getModel();
    sit = model.listStatements(null, predicate, (RDFNode)null);
  }
  while (sit.hasNext()) {
    results.add(sit.next());
  }
  // Iterate into direct subproperties
  StmtIterator it = model.listStatements(null, RDFS.subPropertyOf, predicate);
  while (it.hasNext()) {
    Statement sps = it.next();
    if (!reached.contains(sps.getSubject())) {
      Property subProperty = asProperty(sps.getSubject());
      listAllProperties(subject, subProperty, reached, results);
    }
  }
}

origin: apache/jena

if (goodProp.getModel() == null) {
  final Node n = property.asNode();
  if (property.isAnon()) {
origin: apache/jena

/**
 * test moving things between models
 */
public void testCopyStatement()
{
  final Model model2 = createModel();
  final Statement stmt = model.createStatement(S, P, O);
  Assert.assertEquals(model, stmt.getModel());
  Assert.assertEquals(0, model.size());
  Assert.assertEquals(model, stmt.getSubject().getModel());
  Assert.assertEquals(model, stmt.getPredicate().getModel());
  Assert.assertEquals(model, stmt.getObject().getModel());
  model.add(stmt);
  Assert.assertEquals(1, model.size());
  Assert.assertEquals(model, stmt.getSubject().getModel());
  Assert.assertEquals(model, stmt.getPredicate().getModel());
  Assert.assertEquals(model, stmt.getObject().getModel());
  model2.add(stmt);
  Assert.assertEquals(1, model.size());
  Assert.assertEquals(model, stmt.getSubject().getModel());
  Assert.assertEquals(model, stmt.getPredicate().getModel());
  Assert.assertEquals(model, stmt.getObject().getModel());
  Assert.assertEquals(1, model2.size());
  final Statement stmt2 = model2.listStatements().next();
  Assert.assertEquals(model2, stmt2.getSubject().getModel());
  Assert.assertEquals(model2, stmt2.getPredicate().getModel());
  Assert.assertEquals(model2, stmt2.getObject().getModel());
}
/*
origin: org.apache.jena/jena-core

/**
 * test moving things between models
 */
public void testCopyStatement()
{
  final Model model2 = createModel();
  final Statement stmt = model.createStatement(S, P, O);
  Assert.assertEquals(model, stmt.getModel());
  Assert.assertEquals(0, model.size());
  Assert.assertEquals(model, stmt.getSubject().getModel());
  Assert.assertEquals(model, stmt.getPredicate().getModel());
  Assert.assertEquals(model, stmt.getObject().getModel());
  model.add(stmt);
  Assert.assertEquals(1, model.size());
  Assert.assertEquals(model, stmt.getSubject().getModel());
  Assert.assertEquals(model, stmt.getPredicate().getModel());
  Assert.assertEquals(model, stmt.getObject().getModel());
  model2.add(stmt);
  Assert.assertEquals(1, model.size());
  Assert.assertEquals(model, stmt.getSubject().getModel());
  Assert.assertEquals(model, stmt.getPredicate().getModel());
  Assert.assertEquals(model, stmt.getObject().getModel());
  Assert.assertEquals(1, model2.size());
  final Statement stmt2 = model2.listStatements().next();
  Assert.assertEquals(model2, stmt2.getSubject().getModel());
  Assert.assertEquals(model2, stmt2.getPredicate().getModel());
  Assert.assertEquals(model2, stmt2.getObject().getModel());
}
/*
org.apache.jena.rdf.modelPropertygetModel

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
  • addProperty
  • asResource
  • 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

  • Creating JSON documents from java classes using gson
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • onCreateOptionsMenu (Activity)
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • BoxLayout (javax.swing)
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now