I am trying to build a sparql query in scala. I have issues using the apache arq library which is meant for java. The dependencies seem to be all fine but Intellij cannot resolve the ParameterizedSparqlString constructor and resulting the QueryEngineHTTP constructor. Im running jdk 1.8. Any ideas? Appreciated!!
val sparqlentities = namedEntitiesByDocument
.mapPartitions(iter => {
val sparqlEndpoint = "localhost:1643";
iter.map( t => {
t._1, t._2.map(namedEntity => {
val sparqlQuery = "" + "SELECT ?s { \n ?s rdfs:label" + namedEntity.surfaceForm + " . \n }"
val query = QueryFactory.create(sparqlQuery, Syntax.syntaxARQ)
// val querySolutionMap = new QuerySolutionMap()
val parameterizedSparqlString = new ParameterizedSparqlString(query.toString(), new QuerySolutionMap())
val httpQuery = new QueryEngineHTTP(sparqlEndpoint,parameterizedSparqlString.asQuery())
val results = httpQuery.execSelect()
while (results.hasNext()) {
val solution = results.next()
val fin_result = solution.get("s").asLiteral().getLexicalForm()
(namedEntity.surfaceForm, fin_result)
}
})
})
})