Search in sources :

Example 11 with Model

use of org.openrdf.model.Model in project stanbol by apache.

the class RdfIndexingSource method createRepresentationGraph.

/**
     * Extracts the triples that belong to the {@link Representation} with the
     * parsed id from the Sesame repository.
     * @param con the repository connection
     * @param uri the subject of the Representation to extract
     * @return the representation with the extracted data.
     * @throws RepositoryException 
     */
protected RdfRepresentation createRepresentationGraph(RepositoryConnection con, org.openrdf.model.URI uri) throws RepositoryException {
    RdfRepresentation rep = vf.createRdfRepresentation(uri);
    Model model = rep.getModel();
    extractRepresentation(con, model, uri, followBNodeState ? new HashSet<BNode>() : null);
    return rep;
}
Also used : RdfRepresentation(org.apache.stanbol.entityhub.model.sesame.RdfRepresentation) Model(org.openrdf.model.Model) HashSet(java.util.HashSet)

Aggregations

Model (org.openrdf.model.Model)11 Representation (org.apache.stanbol.entityhub.servicesapi.model.Representation)7 URI (org.openrdf.model.URI)7 RdfRepresentation (org.apache.stanbol.entityhub.model.sesame.RdfRepresentation)6 TreeModel (org.openrdf.model.impl.TreeModel)5 RdfValueFactory (org.apache.stanbol.entityhub.model.sesame.RdfValueFactory)4 Test (org.junit.Test)4 HashSet (java.util.HashSet)3 BNode (org.openrdf.model.BNode)3 LinkedHashModel (org.openrdf.model.impl.LinkedHashModel)3 RepositoryConnection (org.openrdf.repository.RepositoryConnection)3 SparqlFieldQuery (org.apache.stanbol.entityhub.query.sparql.SparqlFieldQuery)2 YardException (org.apache.stanbol.entityhub.servicesapi.yard.YardException)2 JSONObject (org.codehaus.jettison.json.JSONObject)2 Value (org.openrdf.model.Value)2 BindingSet (org.openrdf.query.BindingSet)2 QueryEvaluationException (org.openrdf.query.QueryEvaluationException)2 TupleQueryResult (org.openrdf.query.TupleQueryResult)2 RepositoryException (org.openrdf.repository.RepositoryException)2 HashMap (java.util.HashMap)1