0

i am getting the results of a query as

sodium^^http://www.w3.org/2001/xmlschema/string

What format is it ?

ProgramME
  • 653
  • 3
  • 12
  • 23

2 Answers2

1

It looks to me like you've called toString() on a literal (maybe just by printing it). RDF nodes in your results might be resources (either unlabelled or with a URI), or a literal. Literals are structured things in general, consisting of a lexical form and (optionally) a datatype or language. There's a convention from summarising these complex objects in strings, which you've found here.

For example:

// a plain literal, no datatype, no language
"Sodium"

// typed literal, lexical form "Sodium", datatype xsd:string
"Sodium"^^<http://www.w3.org/2001/xmlschema/string>

// lexical form "Sodium", language "en"
"Sodium"@en 

If you're using jena try getLexicalForm() on the literal. xsd:string is a pretty annoying type.

user205512
  • 8,798
  • 29
  • 28
0

In Rdf this is the way to indicate the data type of a literal. For instance cardinality will be represented as

rdf:datatype="http://www.w3.org/2001/XMLSchema#int

The result says literal "Sodium" of type string.

uncaught_exceptions
  • 21,712
  • 4
  • 41
  • 48