-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TurtleSerializer baseUrl and prefix mappings effect #86
Comments
Actually, the 2nd parameter of |
@koslambrou could you put together a small, compilable, example that demonstrates this? Thanks. |
Here:
Expected output:
Actual output:
|
The actual output in my last comment is not on the latest commit. Here's the actual output:
There's just the @base missing. |
Because in your code: let baseUrl = "http://example.org/resource"
RDF.writeRdf (TurtleSerializer Nothing mappings) emptyRdf You're not using |
Oh right!
The actual output is still:
|
Ah, thanks. The optional argument representing the base URL in the Turtle parser is to use for resolving relative URLs in the document. This may be overridden in the document itself using the @base directive. However in the Turtle serialisation, the optional base URL is used when serialising all URI nodes in the outputted RDF, i.e. normalising prefix:foo to be http://example.com/foo if the |
The following Turtle output contains a relative URI, no?
Isn't Also, I don't understand the use case behind the optional base URL in the Turtle serialisation. Why would we want the convert a single prefix (e.g. |
Say I create a RDF graph.
I'm trying to save the graph in a file and I want to set the baseUrl and prefix mappings.
However, the following won't set the baseUrl and will only put the default prefix mappings (not the ones I specified).
Seems like the only way to set the baseUrl and prefix mapping is through
mkRdf
oraddPrefixMappings
. If that's the case, what is the point ofTurtleSerializer
parameters ?The text was updated successfully, but these errors were encountered: