On 30/03/11 16:52, Nathanael Thompson wrote:
Is there a best practice for building Node objects from Strings (when you
don't know what type of Node the string represents before hand)?

eg.
"Hi Bob!" ->  Node_Literal
http://www.bob.com/Bob ->  Node_URI

If you can use

"'Hi Bob!'" -> Node_Literal
"<http://www.bob.com/Bob>" --> Node_URI

i.e a Java string of the valid Turtle syntax.

then SSE.parseNode will do it (bad name but that's history for you).

NodeFactory.parseNode(string) is a recent attempt to put a better name and then redirect to the current best place to do this. It will eventually be straight into the RIOT tokenizer.

Chris has some code in the test code that parses a more lenient form, I think.

        HTH
        Andy


Thanks,
Nate

Reply via email to