Ios HTTP POST到SPARQL服务器,返回空HTTP 200
我正在向发送HTTP POST请求 使用此查询:Ios HTTP POST到SPARQL服务器,返回空HTTP 200,ios,http,post,sparql,openframeworks,Ios,Http,Post,Sparql,Openframeworks,我正在向发送HTTP POST请求 使用此查询: string query = "PREFIX ah: <http://purl.org/artsholland/1.0/> " "PREFIX data: <http://data.artsholland.com/> " "PREFIX nub: <http://resources.uitburo.nl/> " "PREFIX rdf: <http://www.w3.org/1999/02/22
string query =
"PREFIX ah: <http://purl.org/artsholland/1.0/> "
"PREFIX data: <http://data.artsholland.com/> "
"PREFIX nub: <http://resources.uitburo.nl/> "
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns/> "
"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema/> "
"PREFIX owl: <http://www.w3.org/2002/07/owl/> "
"PREFIX dc: <http://purl.org/dc/terms/> "
"PREFIX foaf: <http://xmlns.com/foaf/0.1/> "
"PREFIX xsd: <http://www.w3.org/2001/XMLSchema/> "
"PREFIX time: <http://www.w3.org/2006/time/> "
"PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos/> "
"PREFIX vcard: <http://www.w3.org/2006/vcard/ns/> "
"PREFIX osgeo: <http://rdf.opensahara.com/type/geo/> "
"PREFIX bd: <http://www.bigdata.com/rdf/search/> "
"PREFIX search: <http://rdf.opensahara.com/search/> "
"PREFIX fn: <http://www.w3.org/2005/xpath-functions/> "
"PREFIX gr: <http://purl.org/goodrelations/v1/> "
"SELECT ?v ?p ?date ?title ?desc ?modified ?type ?genre "
"WHERE { "
"?v a ah:Venue . "
"?p dc:modified ?modified . "
"?e ah:venue ?v . "
"?e ah:production ?p . "
"OPTIONAL {{ "
"?p dc:title ?title . "
"}} "
"OPTIONAL {{ "
"?p ah:shortDescription ?desc . "
"}} "
"OPTIONAL {{ "
"?p ah:productionType ?type . "
"}} "
"OPTIONAL {{ "
"?p ah:genre ?genre . "
"}} "
"?v geo:geometry ?geometry . "
"FILTER (search:distance(?geometry, \"POINT(4.890 52.3764)\"^^<http://rdf.opensahara.com/type/geo/wkt>) < 2000 * " "0.00000898315284) . "
"?e time:hasBeginning ?date . "
"FILTER (?date >= \"2012-09-06T00:00:00Z\"^^xsd:dateTime) . "
"FILTER (?date <= \"2012-09-06T23:59:59Z\"^^xsd:dateTime) . "
"} ORDER BY ?v "
"LIMIT 100 ";
我得到了一张200元的好票,但没有尸体。我已多次修改查询,但仍然没有有效的返回:
使用的库是我在同一个端点上尝试了SPARQL查询,使用该端点的web界面以及演示密钥和您的密钥,但得到了HTTP 500内部服务器错误,而不是空的HTTP 200响应 当我在可选块中使用正确的名称空间并将{{替换为{时,我确实得到了结果
PREFIX ah: <http://purl.org/artsholland/1.0/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX osgeo: <http://rdf.opensahara.com/type/geo/>
PREFIX bd: <http://www.bigdata.com/rdf/search#>
PREFIX search: <http://rdf.opensahara.com/search#>
PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
PREFIX gr: <http://purl.org/goodrelations/v1#>
PREFIX gn: <http://www.geonames.org/ontology#>
您必须使用这些注释,而不是/在其中一些注释中,这很重要。那么您的问题是什么?HTTP 200响应表示查询成功;没有正文不是有效的SPARQL JSON结果。您是否尝试过从一个最小的问题开始,然后扩展它?是否尝试将API键作为表单的一部分发送?
PREFIX ah: <http://purl.org/artsholland/1.0/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX dc: <http://purl.org/dc/terms/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX time: <http://www.w3.org/2006/time#>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX vcard: <http://www.w3.org/2006/vcard/ns#>
PREFIX osgeo: <http://rdf.opensahara.com/type/geo/>
PREFIX bd: <http://www.bigdata.com/rdf/search#>
PREFIX search: <http://rdf.opensahara.com/search#>
PREFIX fn: <http://www.w3.org/2005/xpath-functions#>
PREFIX gr: <http://purl.org/goodrelations/v1#>
PREFIX gn: <http://www.geonames.org/ontology#>