samvera-labs / ldpath

Ruby parser for the LDPath language
http://marmotta.apache.org/ldpath/language.html
Other
9 stars 5 forks source link

Allow limiting returned results to xsd:string #15

Open elrayle opened 5 years ago

elrayle commented 5 years ago

ruby-rdf/rdf Literal#has_datatype? specifically ignores Literals of the xsd:string type. The #plain method checks for string type. So that can be used to check if this is a string and also compare datatype to type if it is. This allows for limiting returned results to strings.

I suspect that the default type is xsd:string. So this may allow more matches than is desired. But without this test change, there are 0 matches when filtering for xsd:string.

I added an issue to ruby-rdf/rdf to ask about the reason for excluding xsd:string. See issue https://github.com/ruby-rdf/rdf/issues/396 for more information.