RDFConnection.fetch() can't Parse DBpedia's IRI #1623
-
Hi, I want to use When I parse RDFConnection conn = RDFConnectionRemote.service("http://dbpedia.org/resource/Resource_Description_Framework").build();
Model model = conn.fetch();
model.write(System.out); I got an error:
Version: apache-jena-libs 4.6.1 But rdflib.js can parse it, RDF2h's demo Whether Did I do something wrong? Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
You should be able to do what you want much more simply like so: Model model = ModelFactory.createDefaultModel();
model.read("http://dbpedia.org/resource/Resource_Description_Framework"); |
Beta Was this translation helpful? Give feedback.
-
I was getting a different error from the report. I can't reproduce the That's an HTTP environment issue. Zero bytes came back from DBPedia or an intermediary - not even the HTTP header. Using
works from here - there are several redirection steps, upgrade to HTTP/2 and bouncing between http and https. Any of these may be unsupported by an intermediate. The ".ttl" needs to be the data resource: The simplest Jena code I can find is
giving 772 triples. As to why JS works, it may be because it ends up at the HTML page (no content negoitation) and parses out the RDFa (that's just a guess). |
Beta Was this translation helpful? Give feedback.
-
Hi,
You can take a look at our Linked Data browser:
https://github.com/AtomGraph/Web-Client
It supports content negatiation.
Martynas
atomgraph.com
…On Sat, 19 Nov 2022 at 09.27, chenkun19960427 ***@***.***> wrote:
Dear @afs <https://github.com/afs> , Thank you very much for your reply!
I don't want to do anything specific with DBpedia IRI:
replace `resource` with `data`, and add `.ttl` to the end
Because the rules are different for every linked data site. I'm looking
for a common way.
As you said, it should be due to the redirection, because I can parse
https://dbpedia.org/resource/Resource_Description_Framework correctly:
HttpClient hc = HttpClient.newBuilder().version(HttpClient.Version.HTTP_1_1).build();Graph g = HttpRDF.httpGetGraph("https://dbpedia.org/resource/Resource_Description_Framework");Model model = ModelFactory.createModelForGraph(g);model.write(System.out);
Does Apache Jena have a direct way to support redirection?
I'll try to get the return data through an http request first and then put
it into Apache Jena for parsing. This seems to parse all IRI (but I
haven't done it yet). I will reply in this discussion when I have the
results.
—
Reply to this email directly, view it on GitHub
<#1623 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGPM5TAIBTEU3VJCV6BL3LWJCFOFANCNFSM6AAAAAASEJ3QAQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Yes Web-Client includes a basic SVG graph layout.
There is no public instance at the moment.
…On Sat, Nov 19, 2022 at 10:19 AM chenkun19960427 ***@***.***> wrote:
Dear @namedgraph <https://github.com/namedgraph> ,
https://github.com/AtomGraph/Web-Client is great.
But I also want to show RDF as a graph, just to make it a little bit more
intuitive.
Probably I haven't learned much about
https://github.com/AtomGraph/Web-Client yet.
By the way, does https://github.com/AtomGraph/Web-Client have an online
access address? I haven't found it yet.
—
Reply to this email directly, view it on GitHub
<#1623 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGPM5UKOKYTZ43S3SWYELLWJCLT3ANCNFSM6AAAAAASEJ3QAQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
I was getting a different error from the report.
Are you behind local proxy or firewall?
I can't reproduce the
Caused by: java.io.IOException: HTTP/1.1 header parser received no bytes
error.That's an HTTP environment issue. Zero bytes came back from DBPedia or an intermediary - not even the HTTP header.
Presumably this is the
Connection reset
- the local connection has been unexpected terminated.Using
curl
:works from here - there are several redirection steps, upgrade to HTTP/2 and bouncing between http and https. Any of these may be unsupported by an intermediate.
T…