You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Coming from SPARQL, if a sub-expression containing a URI with a lexical representation using a prefix or base definition is extracted, the to_sxp method will use that representation even if the prefix or base definition is no longer included.
Describe the solution you'd like
A method for managing prefix and base definition within an S-Expression (SPARQL-specific) which would recursively update the lexical representations of embedded URIs (including literal datatypes) would be nice.
# Possible refinements# Adds a prefix declaration to an Array representation of an S-Exp and recursively update the lexical representations of contained URIsdefadd_prefix(pfx,uri);end# Adds a prefix declaration to an Array representation of an S-Exp and recursively update the lexical representations of contained URIsdefadd_base(uri);end# Returns a deep copy of an Array representation of an S-Exp without the specified prefix and removes any lexical representations from included URIs recursivelydefremove_prefix(pfx);end# Returns a deep copy of an Array representation of an S-Exp without the specified base and removes any lexical representations from included URIs recursivelydefremove_base();end# Returns a deep copy of an Array representation of an S-Exp without any prefix or base declarations.defclear_prefixes;end# Return the prefix definitions from an an Array representation of an S-Expdefprefixes;end
…se expressions and propgating to lower elements to create PNames when serializing only if appropriate.
Consolodates the contents of writer.rb into extensions.rb.
For #20.
This issue was settled without the described API changes. Instead, the signature of .to_sxp was changed to include keyword parameters prefixes and base_uri, which is propagated down. When RDF is included, the Array#to_sxp method looks to see if the array is of the form [:base _iri_ _expr_] or [prefix [['pfx:', _iri_], ...], _expr_] and extracts and passes the prefixes and base_uri parameters to recursive calls of _expr_.to_sxp.
Is your feature request related to a problem? Please describe.
Coming from SPARQL, if a sub-expression containing a URI with a lexical representation using a prefix or base definition is extracted, the
to_sxp
method will use that representation even if the prefix or base definition is no longer included.Describe the solution you'd like
A method for managing prefix and base definition within an S-Expression (SPARQL-specific) which would recursively update the lexical representations of embedded URIs (including literal datatypes) would be nice.
Additional context
See the email thread at https://lists.w3.org/Archives/Public/public-rdf-ruby/2021Dec/0014.html
The text was updated successfully, but these errors were encountered: