Skip to content

N3 method for path objects is bugged #2503

@lukasmu

Description

@lukasmu

The n3 method for path objects returns invalid/unexpected paths for non-trivial paths.

Example:

import rdflib
import rdflib.paths

path = rdflib.RDF.type / rdflib.paths.AlternativePath(rdflib.SKOS.note, rdflib.RDFS.comment)

Calling path.n3() here returns <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/<http://www.w3.org/2004/02/skos/core#note>|<http://www.w3.org/2000/01/rdf-schema#comment> (essentially rdf:type/skos:note|rdfs:comment).
However, it the method should rather return <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>/(<http://www.w3.org/2004/02/skos/core#note>|<http://www.w3.org/2000/01/rdf-schema#comment>) (thus rdf:type/(skos:note|rdfs:comment)).

The n3 method ignores all groups as it never introduces any brackets.

Related to #421

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions