Hi
I am new to stardog. Can i use any random string as Prefix? what is the downside? For example, can i use my name
PREFIX kv: <krishna.vemulapalli#>
what is the downside of such usage?
is PREFIX a way to use ontologies defined by other users? What if my application has no need to reference ontology defined by other users and i need to define my own ontology.
You can’t use any random string. I’d have to look up the exact restrictions but as long as you keep it to something reasonable you should be able to name it whatever you want.
I can’t really think of a downside. They’re really just syntactic sugar that helps you avoid a lot of typing. The example you gave is a perfectly fine prefix name but the namespace isn’t. It needs to be a valid IRI and <krishna.vemulapalli#> isn’t. You could change it to urn:krishna.vemulapalli# or http://krishna.vemulapalli# The IRI doesn’t have to resolve and the domain name isn’t required to be registered to use it although it’s bad practice to use someone else’s domain.
You should be able to use someone else’s ontology or your own or both.
I agree with Zachary that there is no downside to using prefixed URIs. Just remember to include the Prefix line if you ever share the query with someone! Here's a quick example of "syntactic sugar" using one of our application's ontologies.