HTTP GET requests with PREFIX

When I am using PREFIX in the HTTP GET/POST request, I still get the long URIs. Is PREFIX not supported or is a different syntax required?

Example:
Original URL:
http://localhost:5820/<myDB>/query?query=PREFIX code: <https://w3id.org/phuse/code#> SELECT * WHERE {?s ?p ?o}

Encoded URL:
http://localhost:5820/<myDB>/query?query=PREFIX%20code%3A%20%3Chttps%3A%2F%2Fw3id.org%2Fphuse%2Fcode%23%3E%20SELECT%20*%20WHERE%20%7B%3Fs%20%20%3Fp%20%3Fo%7D

Result:
o: Object { type: "uri", value: "https://w3id.org/phuse/code#AgeUnit" } ...

Expected but not received result:
o: Object { type: "uri", value: "code:AgeUnit" } ...

Prefix is correct. Can you edit your post to include the formatted text tag. The forum software has probably mangled your query a bit so it’s hard to tell exactly what you’re running. I’m guessing it’s either a small problem in the query or a url encoding problem.

Hi, I updated the question with remove any formatting. I am using already encodeURIComponent, for this the encoded URL is embedded as well.

It looks like it's a correct result but that you wanted the answer to be prefixed. Is that correct?

I think you just need to register the namespace with stardog namespace add ...

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.