[
http://jira.amdatu.org/jira/browse/AMDATU-183?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ivo Ladage - van Doorn resolved AMDATU-183.
-------------------------------------------
Resolution: Fixed
Issue is resolved. RDF2GO API is now available. To use the RDF2GO API, first
add this to your pom.xml:
<dependency>
<groupId>org.semweb4j</groupId>
<artifactId>rdf2go.api</artifactId>
<version>${rdf2go.version}</version>
<scope>provided</scope>
</dependency>
Remove the dependency to the sesame bundle, as this is no longer needed.
However, the SesameService is deprecated but still fully functional.
Now the Sesame implementation will register a ModelSet service when available.
So define a service depency on ModelSet and you will get the Sesame ModelSet
injected. Subsequently you can use this ModelSet to append your own models or
use the default model (getDefaultModel())
SPARQL
To execute SPARQL queries with RDF2GO, you can use this approach;
String query = "SELECT ?subject WHERE { ?subject a <" + uri + ">}";
Model model = m_modelSet.getDefaultModel();
QueryResultTable result = model.sparqlSelect(query);
ClosableIterator<QueryRow> iterator = result.iterator();
ArrayList<String> subjects = new ArrayList<String>();
try {
while (iterator.hasNext()) {
QueryRow row= iterator.next();
...
}
} finally {
iterator.close();
}
Import RDF files
To import RDF files, one can use the ModeUtils utility class:
ModelUtils.loadFromFile(ConversionUtil.urlToFile(rdfsUrl), Syntax.RdfXml,
m_modelSet.getDefaultModel());
Note that ConversionUtil is a utility class available in the utilities bundle.
To use it, embed this library in your bundle by appending this to your pom.xml:
<dependency>
<groupId>org.amdatu.libraries</groupId>
<artifactId>utilities</artifactId>
<version>${platform.version}</version>
<scope>compile</scope>
</dependency>
> Expose opensesame more in the sesame-service
> --------------------------------------------
>
> Key: AMDATU-183
> URL: http://jira.amdatu.org/jira/browse/AMDATU-183
> Project: Amdatu
> Issue Type: Improvement
> Components: Amdatu Semantic
> Reporter: Koos Gadellaa
> Assignee: Koos Gadellaa
> Priority: Critical
> Fix For: 0.1.0
>
>
> Currently the sesame-service only exposes the add(URL) method from the
> openrdf.connection class.
> However, I'd like to be able to use the add(Statement(s)), add(Inputstream)
> and add(Reader)
> Please open these.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira