# Sparql select to return rdfs type name without prefix

**URL:** <https://community.stardog.com/t/sparql-select-to-return-rdfs-type-name-without-prefix/2153>\
**Category:** Support\
**Created:** [December 16, 2019, 7:09pm UTC](https://community.stardog.com/t/sparql-select-to-return-rdfs-type-name-without-prefix/2153 "2019-12-16T19:09:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [December 16, 2019, 7:09pm UTC](https://community.stardog.com/t/sparql-select-to-return-rdfs-type-name-without-prefix/2153/1 "2019-12-16T19:09:59Z")

</div>

My challenge is (partially) stated in [rdf - SPARQL query that returns prefixed names instead of IRIs - Stack Overflow](https://stackoverflow.com/questions/34301084/sparql-query-that-returns-prefixed-names-instead-of-iris)

- Is there a Stardog helper function that could return the rdfs type name without a prefix?

P.S. I don't want semi columns to be returned either - in case of default prefix.

Thanks,  
Radu

---

<div class="post-metadata">

**Author:** ![R3000](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.stardog.com/r3000/32/358_2.png) [@R3000](https://community.stardog.com/u/R3000)\
**Post date:** [December 16, 2019, 8:53pm UTC](https://community.stardog.com/t/sparql-select-to-return-rdfs-type-name-without-prefix/2153/2 "2019-12-16T20:53:24Z")

</div>

Got it from previous answered topic [Need to format sqarql select results for tableau](https://community.stardog.com/t/need-to-format-sqarql-select-results-for-tableau/1961) Thanks to @pavel

So it is:  
prefix sdf: tag:stardog:api:functions:  
select (sdf:localname(?s) as ?subject) (if(isIRI(?o), sdf:localname(?o), ?o) as ?object) { ?s ?p ?o }

---

<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:** [December 30, 2019, 8:53pm UTC](https://community.stardog.com/t/sparql-select-to-return-rdfs-type-name-without-prefix/2153/3 "2019-12-30T20:53:31Z")

</div>

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