I would run this query:
SELECT DISTINCT ?id str(?name)
but Fuseki give me this error: This line is invalid.Expected ( VAR1...
I would need a string value of ?name.
I'm trying to change the URI of a resource in a Model.
I'm using ResourceUtils.renameResource it works, but when i save the model in a file, the new URI is extended (has the form instead of prefix:resource) even though…
For example, i have a jena OntModel, with many classes, individuals and properties.
I want to konw how many datatypeProperty and objectProperty are set for an specific individual.
I have code below, given an Individual, ind.listProperties() will…
I am using Eclipse and Jena. I have already made some queries that worked, and I cant find the mistake in this one. This is my code:
// Create a SPARQL query from the given string.
String queryString = //"PREFIX rdfs:…
I want to convert Java object to RDF XML. I am using Jena API. I don't want to call any REST call.
On REST method, we can write:
@Produces(OslcMediaType.APPLICATION_RDF_XML)
So it sends the response in RDF XML format.
I can't use this, because I…
I am trying to query my dataset via HTTP 'get' method. I am using POSTMAN to use the HTTP method.
Here is my complete url
//localhost:3030/DS-1/sparql?query=PREFIX test:http://www.semanticweb.org/muhammad/ontologies/2017/2/untitled-ontology-14#…
Individual ind = model.createIndividual("http://www.semanticweb.org/ontologies/Word#Human", isSynonymOf);
System.out.println( "Synonyms of given instance are:" );
StmtIterator it =ind.listProperties(isSynonymOf);
while( it.hasNext() )…
In thingweb-repository in file ThingDescriptionCollectionHandler.java
on line 173:
tdb = dataset.getDefaultModel();
tdb.createResource(resourceUri.toString()).addProperty(DC.source, data);
Question: I am trying to write a SPARQL query to run…
We have a cloud base Java application that uses Oracle DB and Apache Solr for document indexing/searching. I need to implement an ontology and I intend to use Apache Jena. It's an uncharted territory for me. According to the docs, seems that using…
Here is my code:
public class FunctionalityCheckTest1 {
InfModel infModel;
Model model = ModelFactory.createDefaultModel();
String NS = "http://myweb.com/vocab#";
@Test
public void playingWithJenaReasoner()
{
…
I have a java code that load an ontology and then use it.
the code work correctly when I run program using eclipse. but when I convert project to runnable jar file it can not load the ontology.it does not produce any error. It seems it tacks many…
I don't know why after setting setNsPrefix of Model it doesn't work according to my expectation.This is my Java Code
public class TestClass
{
public static void main(String[] args){
Model model = ModelFactory.createDefaultModel();
…
I'm having trouble with OntClass.listSubClasses. I'm using this method in a loop, which works fine until a given point:
for(Iterator i = class.listSubClasses() ; i.hasNext() ;) {
System.out.println(((OntClass) i.next()).getLocalName());
}
Then,…