Triply-Dev / YASGUI.YASR-deprecated

Deprecated, see https://github.com/TriplyDB/Yasgui for the Yasgui monorepo
MIT License
26 stars 22 forks source link

"ReferenceError: mainXml is not defined" with construct queries #9

Closed jneubert closed 10 years ago

jneubert commented 10 years ago

In YASGUI, the output of a construct query is displayed as rdf in turtle syntax. With YASR, the above error is given. Perhaps it could be figured out from the format of the actual result, that this is plain rdf, and could be formatted accordingly.

LaurensRietveld commented 10 years ago

Could you give me a test-case? This works on the regular yasr site on DBpedia [1]. This probably has something to do with the particular returned resultset of your endpoint, so an example is welcome ;)

[1] http://yasr.yasgui.org/?query=CONSTRUCT+%7B%0A++%0A++%3Fx+%3FY+%3FJ%7D%0AWHERE+%7B%3Fx+%3FY+%3FJ%7D+LIMIT+8

jneubert commented 10 years ago

Here is an example where the error is triggered. The endpoint is Fuseki at http://zbw.eu/beta/sparql/stwv/query.

jneubert commented 10 years ago

An additional comment on your example: It returns and displays a sparql-results+json response, whereas in YASGUI the same query (http://bit.ly/ZD9HrA) returns plain rdf formatted as turtle (which is what I would expect).

LaurensRietveld commented 10 years ago

fixed this particular issue. This was both an issue in the other YASGUI-utils library (storing an xml document), as well as an issue in YASR. The first was fixed via this commit https://github.com/YASGUI/Utils/commit/007bc86e92cd6d875f1c4b7704eba0afd3db998a.

About the different content type returned: that's simply because YASQE does not provide a content header (or, always requests a json, if I'm correct). This is configurable statically by (on YASQE initialization) adding an 'Accept' header to YASQE.defaults.sparql.headers []. Though, I'll try to see whether this is something we can make dynamic in YASQE, i.e. an option for 'preferredSelectContentType' and 'preferredConstructContentType' (see https://github.com/YASGUI/YASQE/issues/25)