dotnetrdf

Query dbpedia sparql endpoint using dotnetRDF - RDFParseException

≯℡__Kan透↙ 提交于 2019-12-10 10:03:29
问题 When I execute the following query on http://dbpedia.org/sparql using (dotnetRDF) VDS.RDF.Query.SparqlRemoteEndpoint.QueryWithResultSet() everything works fine. SELECT ?film ?p ?o WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Japanese_films> . ?film ?p ?o } limit 500 But when I try this query using SparqlRemoteEndpoint.QueryWithResultGraph() CONSTRUCT { ?film ?p ?o} WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category

Query dbpedia sparql endpoint using dotnetRDF - RDFParseException

ぃ、小莉子 提交于 2019-12-06 01:06:16
When I execute the following query on http://dbpedia.org/sparql using (dotnetRDF) VDS.RDF.Query.SparqlRemoteEndpoint.QueryWithResultSet() everything works fine. SELECT ?film ?p ?o WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Japanese_films> . ?film ?p ?o } limit 500 But when I try this query using SparqlRemoteEndpoint.QueryWithResultGraph() CONSTRUCT { ?film ?p ?o} WHERE { ?film <http://purl.org/dc/terms/subject> <http://dbpedia.org/resource/Category:Japanese_films> . ?film ?p ?o } limit 500 I've got RdfParseException with message "[Line 456 Column 29]

dotnetrdf xml exception using QueryWithResultSet

余生颓废 提交于 2019-12-02 17:04:16
问题 I have an asp.net project in which, I would like to query DBPedia. Using the following code I am getting an error: public string testEndpoint() { //TEST02 SparqlRemoteEndpoint endpoint = new SparqlRemoteEndpoint(new Uri("http://dbpedia.org/sparql"), "http://dbpedia.org"); string res = ""; //Make a SELECT query against the Endpoint SparqlResultSet results = endpoint.QueryWithResultSet("SELECT ?year WHERE {dbpedia:Rihanna dbpedia-owl:birthYear ?year}"); foreach (SparqlResult result in results)

SPARQL delete query dotNetRDF does not modify RDF file

三世轮回 提交于 2019-11-27 08:19:03
问题 I like to delete a RDF tuple from a RDF file using dotNetRDF. Here is the code I'm using public void deleteDest(string destID) { TripleStore store = new TripleStore(); Graph rdf = new Graph(); FileLoader.Load(rdf, rdfFilePath, new RdfXmlParser()); store.Add(rdf); SparqlUpdateParser parser = new SparqlUpdateParser(); SparqlParameterizedString cmdString = new SparqlParameterizedString(); cmdString.CommandText = "PREFIX j.0: <http://www.example.org/destDetails#>" + "PREFIX xsd: <http://www.w3

Why does my SPARQL query return the URI of a resource instead of its name?

别来无恙 提交于 2019-11-26 17:57:51
I want to get all classes of my ontology. This is a part of my ontology file in RDF/XML format created by Protege: <!-- http://www.w3.org/2002/07/owl#aqua --> <Class rdf:about="&owl;aqua"/> <!-- http://www.w3.org/2002/07/owl#varioPerfect --> <Class rdf:about="&owl;varioPerfect"/> I wrote this query, which works properly in Protege, but when I use it in dotNetRDF it returns the full URI of the class instead of just its name. public string[] ontologysearch() { List<string> list = new List<string>(); TripleStore store = new TripleStore(); Graph mygraph = new Graph(); mygraph.LoadFromFile("D:/msc