# HTTP GET requests with PREFIX

**URL:** <https://community.stardog.com/t/http-get-requests-with-prefix/1569>\
**Category:** Support\
**Created:** [April 4, 2019, 7:14am UTC](https://community.stardog.com/t/http-get-requests-with-prefix/1569 "2019-04-04T07:14:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cayburn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/cayburn/32/400_2.png) [@cayburn](https://community.stardog.com/u/cayburn)\
**Post date:** [April 4, 2019, 7:14am UTC](https://community.stardog.com/t/http-get-requests-with-prefix/1569/1 "2019-04-04T07:14:45Z")

</div>

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" } ...`

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [April 4, 2019, 10:39am UTC](https://community.stardog.com/t/http-get-requests-with-prefix/1569/2 "2019-04-04T10:39:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cayburn](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/cayburn/32/400_2.png) [@cayburn](https://community.stardog.com/u/cayburn)\
**Post date:** [April 4, 2019, 11:58am UTC](https://community.stardog.com/t/http-get-requests-with-prefix/1569/3 "2019-04-04T11:58:19Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![zachary.whitley](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/zachary.whitley/32/94_2.png) [@zachary.whitley](https://community.stardog.com/u/zachary.whitley)\
**Post date:** [April 4, 2019, 12:59pm UTC](https://community.stardog.com/t/http-get-requests-with-prefix/1569/4 "2019-04-04T12:59:00Z")

</div>

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 ...`

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex030/uploads/stardog/original/2X/e/ed66b48a616f505106a4acde3c9cee7e6da9bc67.svg) [@system](https://community.stardog.com/u/system)\
**Post date:** [April 18, 2019, 12:59pm UTC](https://community.stardog.com/t/http-get-requests-with-prefix/1569/5 "2019-04-18T12:59:07Z")

</div>

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