104 reveals that the current SPARQL serializer will always add prefix declarations when calling $a->as_sparql(namespaces => $map), even when $a isn't a top-level query object. The tests included in #104 include examples of serializing bare IRIs, and getting:
This needs to be changed so that prefix declarations are only emitted for top-level queries. Special care should be taken to avoid emitting new declarations for sub-queries.
I'm not sure if this fix needs to happen in AtteanX::Serializer::SPARQL, Attean::API::SPARQLSerializable->sparql_tokens, or Attean::API::SPARQLSerializable->as_sparql.
104 reveals that the current SPARQL serializer will always add prefix declarations when calling
$a->as_sparql(namespaces => $map)
, even when$a
isn't a top-level query object. The tests included in #104 include examples of serializing bare IRIs, and getting:This needs to be changed so that prefix declarations are only emitted for top-level queries. Special care should be taken to avoid emitting new declarations for sub-queries.
I'm not sure if this fix needs to happen in
AtteanX::Serializer::SPARQL
,Attean::API::SPARQLSerializable->sparql_tokens
, orAttean::API::SPARQLSerializable->as_sparql
.