Revision 51258
Added by Alessia Bardi about 6 years ago
VirtuosoReadAPI.java | ||
---|---|---|
118 | 118 |
//log.debug(describeQuery); |
119 | 119 |
//Can't use DESCRIBE query: server decides what to return (i.e. not all triples) and cannot find out if and how Virtuoso can be configured |
120 | 120 |
|
121 |
String q = "DEFINE input:inference \'parthenos_rules\' CONSTRUCT {<%s> ?p ?o . } WHERE { <%s> ?p ?o .}"; |
|
122 |
//String q = "CONSTRUCT {<%s> ?p ?o . } WHERE { <%s> ?p ?o . }"; |
|
123 |
String query = String.format(q, subjectURL, subjectURL, subjectURL, subjectURL); |
|
121 |
String q = "DEFINE input:inference 'parthenos_rules' CONSTRUCT {<%s> ?p ?o . } WHERE { <%s> ?p ?o .}"; |
|
122 |
String query = String.format(q, subjectURL, subjectURL); |
|
124 | 123 |
sendConstructResponse(query, responseStream); |
125 | 124 |
|
125 |
|
|
126 |
|
|
126 | 127 |
} |
127 | 128 |
|
128 | 129 |
@RequestMapping(value = "/virtuoso/subjectForJRR", produces = { "application/rdf+xml", "application/xml" }, method = RequestMethod.GET) |
... | ... | |
143 | 144 |
|
144 | 145 |
protected void sendConstructResponse(final String query, final OutputStream responseStream){ |
145 | 146 |
log.debug(query); |
147 |
log.debug("SPARQL endpoint: "+sparqlUrl); |
|
146 | 148 |
final QueryEngineHTTP serviceRequest = new QueryEngineHTTP(sparqlUrl, query); |
147 | 149 |
Model resultModel = serviceRequest.execConstruct(); |
148 | 150 |
RDFDataMgr.write(responseStream, resultModel, RDFFormat.RDFXML_PLAIN); |
... | ... | |
150 | 152 |
serviceRequest.close(); |
151 | 153 |
} |
152 | 154 |
|
155 |
|
|
153 | 156 |
|
154 | 157 |
|
155 | 158 |
|
159 |
|
|
156 | 160 |
} |
Also available in: Unified diff
Getting unexpected 406 because of wrong sparql query..some debug logs might help