Hello everyone,
I am trying to execute a SPARQL query by making a call to fuseki server
running at default port 3030. The query is as follows.
PREFIX univ: <http://example.com#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?subject ?predicate ?object
FROM <http://example.data/University3A>
WHERE
{ { { ?subject univ:doctoralDegreeFrom ?object
{ { ?subject rdf:type univ:FullProfessor}
UNION
{ ?subject rdf:type univ:AssistantProfessor}
UNION
{ ?subject rdf:type univ:AssociateProfessor}
UNION
{ ?subject rdf:type univ:Lecturer}
}
}
UNION
{ ?subject univ:mastersDegreeFrom ?object
{ { ?subject rdf:type univ:FullProfessor}
UNION
{ ?subject rdf:type univ:AssistantProfessor}
UNION
{ ?subject rdf:type univ:AssociateProfessor}
UNION
{ ?subject rdf:type univ:Lecturer}
}
}
UNION
{ ?subject univ:undergraduateDegreeFrom ?object
{ { ?subject rdf:type univ:FullProfessor}
UNION
{ ?subject rdf:type univ:AssistantProfessor}
UNION
{ ?subject rdf:type univ:AssociateProfessor}
UNION
{ ?subject rdf:type univ:Lecturer}
}
}
UNION
{ ?subject univ:emailAddress ?object
{ { ?subject rdf:type univ:FullProfessor}
UNION
{ ?subject rdf:type univ:AssistantProfessor}
UNION
{ ?subject rdf:type univ:AssociateProfessor}
UNION
{ ?subject rdf:type univ:Lecturer}
}
}
UNION
{ ?subject univ:name ?object}
UNION
{ ?subject univ:researchInterest ?object}
UNION
{ ?subject univ:teacherOf ?object}
UNION
{ ?subject univ:worksFor ?object
{ { ?subject rdf:type univ:FullProfessor}
UNION
{ ?subject rdf:type univ:AssistantProfessor}
UNION
{ ?subject rdf:type univ:AssociateProfessor}
UNION
{ ?subject rdf:type univ:Lecturer}
}
}
UNION
{ ?subject univ:name ?object
{ { ?subject rdf:type univ:Course}}
}
UNION
{ ?subject univ:name ?object
{ { ?subject rdf:type univ:Department}}
}
UNION
{ ?subject univ:suborganizationof ?object
{ { ?subject rdf:type univ:Department}}
}
UNION
{ ?subject univ:name ?object
{ { ?subject rdf:type univ:GraduateCourse}}
}
UNION
{ ?subject univ:advisor ?object
{ { ?subject rdf:type univ:GraduateStudent}
UNION
{ ?subject rdf:type univ:ResearchAssistant}
UNION
{ ?subject rdf:type univ:TeachingAssistant}
}
}
UNION
{ ?subject univ:emailAddress ?object
{ { ?subject rdf:type univ:GraduateStudent}
UNION
{ ?subject rdf:type univ:ResearchAssistant}
UNION
{ ?subject rdf:type univ:TeachingAssistant}
}
}
UNION
{ ?subject univ:memberOf ?object
{ { ?subject rdf:type univ:GraduateStudent}
UNION
{ ?subject rdf:type univ:ResearchAssistant}
UNION
{ ?subject rdf:type univ:TeachingAssistant}
}
}
UNION
{ ?subject univ:name ?object
{ { ?subject rdf:type univ:GraduateStudent}
UNION
{ ?subject rdf:type univ:ResearchAssistant}
UNION
{ ?subject rdf:type univ:TeachingAssistant}
}
}
UNION
{ ?subject univ:name ?object}
UNION
{ ?subject univ:publicationAuthor ?object}
UNION
{ ?subject univ:suborganizationOf ?object
{ { ?subject rdf:type univ:ResearchGroup}}
}
UNION
{ ?subject rdf:type univ:University}
}
}
Data set used to query upon is the synthetic data generated using data
generator script available at http://swat.cse.lehigh.edu/projects/lubm/
(UBA 1.7) with command 3 university as the command line argument and name
space as "http://example.com"
*Problem* : When I try to run the code to submit query using
QueryEngineHTTP I get an error mainly *broken line : "some text"*, and each
time I run the code to query dataset I get different type of text like
"broken line (new line) : ty", "broken line (new line) : www".
I tried to peep in the generated data, but I was not able to find any new
line in the file or any error.
Interestingly, when data is generated using above script UBA 1.7 with "1"
university as argument I get no such error for the same query (may be
number of triples are one third when compared with 3 as argument).
*Code* used is as follows :
Query query = QueryFactory.create(sparqlQuery, Syntax.syntaxARQ) ;
List<Var> varList = query.getProjectVars();
QueryEngineHTTP httpQuery = new QueryEngineHTTP(sparqlEndpoint,query);
System.out.println(httpQuery.getQuery().toString());
ResultSet results = httpQuery.execSelect();
exceptions are generated while calling "execSelect()" function.
Please let me know if there is any work around for it.
Ankur.