Mailing list ARC-DEV: Archives

LOADing DBpedia URIs with escaped chars (followup of twitter convo)

From: "Patrick Murray-John" 
Subject: LOADing DBpedia URIs with escaped chars (followup of twitter
	convo)
Date: Sun, 24 May 2009 11:26:57 -0400


Benji,

Thanks for responding about loading DBpedia URIs.  I'm using the latest =
version, and from the endpoint am trying to do this LOAD:

LOAD <http://dbpedia.org/resource/Constructivism_%28learning_theory%29>

The interesting thing is it is returning just one triple, which uses the =
unescaped parens:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ns0: <http://dbpedia.org/class/yago/> .

<http://dbpedia.org/resource/Constructivism_(learning_theory)> rdf:type =
ns0:PsychologicalTheories


This leads me into areas beyond my understanding, but here's some results =
trying to chase things down with curl :


$ch =3D curl_init('http://dbpedia.org/resource/Constructivism_%28learning_t=
heory%29');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/rdf+xml') =
);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);=20
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$data =3D curl_exec($ch);
curl_close($ch);
print $data;

and the $data is:

HTTP/1.1 303 See Other
Server: Virtuoso/05.11.3039 (Solaris) x86_64-sun-solaris2.10-64  VDB
Connection: close
Date: Sun, 24 May 2009 14:50:21 GMT
Accept-Ranges: bytes
TCN: choice
Vary: negotiate,accept
Content-Location: Constructivism_(learning_theory).xml
Content-Type: application/rdf+xml; qs=3D0.95
Location: http://dbpedia.org/data/Constructivism_(learning_theory).xml
Content-Length: 0

HTTP/1.1 200 OK
Server: Virtuoso/05.11.3039 (Solaris) x86_64-sun-solaris2.10-64  VDB
Connection: Keep-Alive
Date: Sun, 24 May 2009 14:50:21 GMT
Accept-Ranges: bytes
Content-Type: application/rdf+xml; charset=3DUTF-8
Content-Length: 354

<Xxml version=3D"1.0" encoding=3D"utf-8" ?>
<rdf:RDF xmlns:rdf=3D"http://www.w3.org/1999/02/22-rdf-syntax-ns#" =
xmlns:rdfs=3D"http://www.w3.org/2000/01/rdf-schema#">
<rdf:Description rdf:about=3D"http://dbpedia.org/resource/Constructivism_(l=
earning_theory)"><rdf:type rdf:resource=3D"http://dbpedia.org/class/yago/Ps=
ychologicalTheories"/></rdf:Description>
</rdf:RDF>

Same result using curl from terminal.=20
(The real data I'm trying to get to has many triples.)

I don't have a good understanding of HTTP, but this redirect to the xml =
file with unescaped parens makes me wonder if there's something I'm =
missing in the way PHP and/or cURL is configured on my laptop, because it =
looks like the data returned from LOAD in the ARC endpoint is the same as =
the data from a straight cURL, bypassing ARC altogether.

Any thoughts are much appreciated!

Patrick