Closed gothub closed 6 years ago
After experimenting with adding the language tag for literal nodes, the following query is used to test it:
stmt <- new("Statement",
world = world,
subject="",
predicate="http://schema.org/name",
object="Jean-Pierre Rampal",
language="fr")
addStatement(model, stmt)
query <-'SELECT ?o WHERE { ?s ?p ?o}'
queryObj <- new("Query", world, query)
queryResult <- executeQuery(queryObj, model)
r <-getNextResult(queryResult)
The value for r$o
is "\"Jean-Pierre Rampal\"@fr"
i.e.
> cat(r$o)
"Jean-Pierre Rampal"@fr
So the redland library has created a string within a string.
Is this acceptable?
Nice, this is great! The string-within-string thing is fine; the same thing already happens if you give a datatype URI.
For printing, in rdflib
I've defined a print method that displays triples using a standard serialization (e.g. nquads
) via cat
, which sidesteps the display issue with the escaped quotations somewhat.
Added to Node initialize()
and Statement initialize()
in commits 1517e9e2e145e492d6a04c5a3012b2caaf6557f0 and 88da8c85ecbbce645894fc48a9917a434b56f986
It's not possible to specify the language for an RDF literal node using the
Node()
method. The following NTriples statement shows a literal node with the language specified as Spanish:To create a node like this, the
Node()
method needs to be updated to accept a language argument, i.e.:then this could be used to create a Statement: