Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parsing nested liberals. #46

Open
zheyxu opened this issue Jul 29, 2024 · 2 comments
Open

Parsing nested liberals. #46

zheyxu opened this issue Jul 29, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@zheyxu
Copy link
Collaborator

zheyxu commented Jul 29, 2024

Some turtle formats are not supported by the Rdflib parser. Following are some examples.

Example 1

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix ex: <http://example.org/stuff/1.0/> .

<http://www.w3.org/TR/rdf-syntax-grammar>
  dc:title "RDF/XML Syntax Specification (Revised)" ;
  ex:editor [
    ex:fullname "Dave Beckett";
    ex:homePage <http://purl.org/net/dajobe/>
  ] .

Example 2

@prefix : <http://example.org/stuff/1.0/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
:a :b
  [ rdf:first "apple";
    rdf:rest [ rdf:first "banana";
               rdf:rest rdf:nil ]
  ] .

The issue is the extension of issue #34

@zheyxu zheyxu self-assigned this Jul 29, 2024
@zheyxu zheyxu changed the title Parsing different ttl file formats Parsing nested liberals. Jul 30, 2024
@zheyxu
Copy link
Collaborator Author

zheyxu commented Aug 5, 2024

The parser can handle first example but not second one.

@zheyxu zheyxu added the bug Something isn't working label Aug 6, 2024
@srodriguez142857
Copy link
Collaborator

@zheyxu:
The first line declares a "default" prefix: there's no prefix associated with the IRI http://example.org/stuff/1.0/.
The first triple is expanded in the following way:

(subject, predicate, object)

  • subject: <http://example.org/stuff/1.0/a>
  • predicate: <http://example.org/stuff/1.0/b>
  • object: It's an RDF list of strings. It will yield [ "apple", "banana" ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants