"PREFIX" in music_mappings.ttl

Dear all,

I was following the using-virtual-graph tutorial and successfully completed all the steps with the help from this community. Now I'm trying to build up my own virtual graph and have a problem about the PREFIX.

In music_mappings.ttl, there are two lines of PREFIX on the top,

PREFIX : <http://stardog.com/tutorial/>
PREFIX sm: <tag:stardog:api:mapping:>

I understand that they define the namespace, but I don't quite understand how they did the job. When I tried to access http://stardog.com/tutorial/, I got a 404 page, let alone the second line of PREFIX, which is even more mysterious to me. So how exactly can they define namespace?

I understand that the database created in mysql by using music_schema.sql and beatles.sql was then mapped to virtual graph in stardog by using music_mappings.ttl. Now that I have created my own database in mysql and I wanted to map it to virtual graph too, but how should I use PREFIX in my own ttl mapping file?


Hi Ying,

We actually have a section in a different tutorial that covers IRIs and this PREFIX notation quite well: https://www.stardog.com/tutorials/data-model/#toc6. Pay special attention to the note at the bottom of that section that explains the difference between a URL and an IRI that is formed like one.

Hi Stephen,

Great. I will work on the other tutorial.


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