congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
com.hp.hpl.jena.rdf.model
Code IndexAdd Tabnine to your IDE (free)

How to use com.hp.hpl.jena.rdf.model

Best Java code snippets using com.hp.hpl.jena.rdf.model (Showing top 20 results out of 855)

origin: stackoverflow.com

 public static void main(String[] args) throws IOException {
  Model model=ModelFactory.createDefaultModel();
  model.read(new FileInputStream("simpsons.ttl"),null,"TTL");
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

protected static void addSubclassesFrom( Model result, Model schema )
  {
  for (StmtIterator it = schema.listStatements( ANY, RDFS.subClassOf, ANY ); it.hasNext();)
    { 
    Statement s = it.nextStatement();
    if (s.getSubject().isURIResource() && s.getObject().isURIResource()) result.add( s ); 
    }
  }

origin: org.ow2.weblab.core.helpers/rdf-helper-jena

/**
 * @param rs
 *            The reified statement to look for predicate.
 * @return The predicate uri or null if an error occurs
 */
protected String getReifiedStatementPredicate(final ReifiedStatement rs) {
  return rs.getStatement().getPredicate().getURI();
}
origin: epimorphics/elda

private Model normalizeModel(Model m) {
  Model norm = ModelFactory.createDefaultModel();
  norm.add(m);
  // Filter out labels which we may or may not be fetching
  for (StmtIterator i = norm.listStatements(null, RDFS.label, (RDFNode) null); i.hasNext();) {
    i.next();
    i.remove();
  }
  return norm;
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

protected Content getInitialContent( Assembler a, Resource root )
  {
  Model partial = ModelFactory.createDefaultModel();
  Resource combined = partial.createResource();
  for (StmtIterator it = root.listProperties( JA.initialContent ); it.hasNext();)
    transferContentProperties( partial, it.nextStatement().getResource(), combined );
  return contentFromModel( a, root, partial, combined );
  }
origin: epimorphics/elda

private String asBody( RDFNode n ) {
  if (n.isLiteral()) return n.asLiteral().getLexicalForm();
  if (n.isResource()) return n.asResource().getURI();
  return n.toString();
}

origin: culturecommunication/ginco

  public boolean selects(Statement s) {
    if (s.getObject().isResource()) {
      Resource res = s.getObject().asResource();
      return res.equals(FOAF.Organization);
    } else {
      return false;
    }
  }
};
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

protected int countArcsTo(Property prop, Resource resource) 
{
  int numArcs = 0 ;
  StmtIterator sIter = resource.getModel().listStatements(null, prop, resource) ;
  for ( ; sIter.hasNext() ; )
  {
    sIter.nextStatement() ;
    numArcs++ ;
  }
  sIter.close() ;
  return numArcs ;
}
origin: com.hp.hpl.jena/arq

public Resource asRDF(Model model, boolean result)
{
  Resource results = model.createResource() ;
  results.addProperty(RDF.type, ResultSetGraphVocab.ResultSet) ;
  Literal lit = model.createTypedLiteral(result) ;
  results.addProperty(ResultSetGraphVocab.p_boolean, lit) ;
  return results ;
}
origin: com.googlecode.foresite-toolkit/foresite

public boolean hasProxy()
    throws OREException
{
  Selector selector = new SimpleSelector(null, ORE.proxyFor, res);
  StmtIterator itr = model.listStatements(selector);
  if (itr.hasNext())
  {
    return true;
  }
  return false;
}
origin: org.ow2.weblab.core.helpers/rdf-helper-jena

/**
 * Closes the model and the temporary model. Recreates a temporary model just in case.
 */
public void close() {
  this.model.close();
  this.tempModel.close();
  this.tempModel = ModelFactory.createDefaultModel();
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

private Resource completedClone( Resource root, Resource newRoot, Model fragment )
  {
  Model typed = fragment.add( newRoot, RDF.type, JA.Content );
  return newRoot.inModel(  ModelFactory.createUnion( root.getModel(), typed ) );
  }
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/**
   Answer <code>model</code> after updating it with the sub-graph of
   <code>s</code> rooted at <code>r</code>, bounded by this instances
   <code>boundary</code>.
*/
public Model extractInto( Model model, Resource r, Model s )
  { TripleBoundary tb = boundary.asTripleBoundary( s );
  Graph g = getGraphExtract( tb ) .extractInto( model.getGraph(), r.asNode(), s.getGraph() );
  return ModelFactory.createModelForGraph( g ); }

origin: usc-isi-i2/Web-Karma

private boolean isInstanceOfTheClass(Resource resource, Resource class_resource) {
  Property type_property = ResourceFactory.createProperty(Namespaces.RDF + "type");
  
  if (resource == null || !resource.isResource())
    return true;
  
  if (resource.hasProperty(type_property, class_resource))
    return true;
  else
    return false;
}

origin: com.googlecode.foresite-toolkit/foresite

public void clearTypes()
{
  StmtIterator itr = res.listProperties(RDF.type);
  model.remove(itr);
}
origin: epimorphics/elda

private void disableDefaultMetadata(Resource root) {
  List<Statement> dd = root.listProperties(ELDA_API.disable_default_metadata).toList();
  for (Statement d: dd) {
    boolean disable = d.getBoolean();
    disableDefaultMetadata = disable;
  }
}
origin: org.apache.clerezza.ext/org.apache.jena.jena-core

public StatementImpl(Resource subject, Property predicate, RDFNode object)
  {
  super( empty );
  this.subject = subject.inModel( model );
  this.predicate = predicate.inModel( model );
  this.object = object.inModel( model );
  }    

origin: culturecommunication/ginco

  public boolean selects(Statement s) {
    if (s.getObject().isResource()) {
      return s.getObject().asResource()
          .equals(SKOS.CONCEPTSCHEME);
    } else {
      return false;
    }
  }
};
origin: usc-isi-i2/Web-Karma

private boolean isInstanceOfTheClass(Resource resource, Resource class_resource) {
  Property type_property = ResourceFactory.createProperty(Namespaces.RDF + "type");
  
  if (resource == null || !resource.isResource())
    return true;
  
  if (resource.hasProperty(type_property, class_resource))
    return true;
  else
    return false;
}

origin: org.apache.clerezza.ext/org.apache.jena.jena-core

/** Creates new StatementImpl */
public StatementImpl(Resource subject, Property predicate, RDFNode object,
    ModelCom model)
  {
  super( model );
  this.subject = subject.inModel( model );
  this.predicate = predicate.inModel( model );
  this.object = object.inModel( model );
  }

com.hp.hpl.jena.rdf.model

Most used classes

  • Model
    An RDF Model. An RDF model is a set of Statements. Methods are provided for creating resources, prop
  • ModelFactory
    ModelFactory provides methods for creating standard kinds of Model. (ModelFactoryBase is helper func
  • Resource
    An RDF Resource. Resource instances when created may be associated with a specific model. Resources
  • RDFNode
    Interface covering RDF resources and literals. Allows probing whether a node is a literal/[blank, UR
  • Statement
    An RDF Statement.A Statement is not a Resource, but can produce a ReifiedStatement that represents i
  • StmtIterator,
  • Property,
  • ResIterator,
  • NodeIterator,
  • ResourceFactory,
  • AnonId,
  • RDFWriter,
  • RDFReader,
  • ModelMaker,
  • SimpleSelector,
  • InfModel,
  • RDFList,
  • RSIterator,
  • ReifiedStatement
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