Replies: 2 comments 4 replies
-
Hi, hmm well it actually depends on the format, because different formats may write blank nodes and values differently (eg "_:" for blank node and '<' to indicate the start of an URI in N-Triples, while that's not the case in e.g. JSON-LD) Could you provide some additional background where the string you want to parse comes from (is it something a user has to provide in a web interface, or is it read from a file or something ?) Best regards Bart |
Beta Was this translation helpful? Give feedback.
-
Hi! Thank you for your help! Basically the strings are coming from objects of the type Resource, IRI, Value. I discovered that I can check what they are by asking "instanceof BNode" and so on. So I found a solution to my problem. Proposal. Why do we do not add some methods like "isBlankNode()" to the different classes to check this? At least the complier will propose it and I think people will find the information faster? Thank you again |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I have the following problem. I have a string that I want to parse into a Resource, IRI or Value. I know about the ValueFactory that has methods to create IRIs, Literals and so on. The problem is that I do not know if the string represents a blank node, literal or URI.
The task is very similar to parsing a file, besides that here it is just one "node".
Does anyone has an idea. The only one I had was to do:
if starts with "_" -> value factory.createBlank
if starts with """ -> value factory.createLiteral
and so on ....
Thank you
D063520
Beta Was this translation helpful? Give feedback.
All reactions