anusii / solidpod

MIT License
1 stars 2 forks source link

RDFLIB: Parsing different ttl file formats #218

Open anushkavidanage opened 4 months ago

anushkavidanage commented 4 months ago

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 ]
  ] .

Example 3

@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh_data: <http://yarrabah.net/data/solid-health#> .
@prefix sh_onto: <http://sii.cecs.anu.edu.au/onto/solid-health#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
sh_data:Info-17809g89a a sh_onto:InfoTab,
        owl:NamedIndividual ;
    rdfs:label "label_name"^^xsd:string ;
    sh_onto:commentP """1. First comment.
2. Second comment.
3. Third comment."""^^xsd:string .

Example 4

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix show: <http://example.org/vocab/show/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

show:218 rdfs:label "That Seventies Show"^^xsd:string .            
show:218 rdfs:label "That Seventies Show"^^<http://www.w3.org/2001/XMLSchema#string> . 
show:218 rdfs:label "That Seventies Show" .                                           
show:218 show:localName "That Seventies Show"@en .                 
show:218 show:localName 'Cette Série des Années Soixante-dix'@fr . 
show:218 show:localName "Cette Série des Années Septante"@fr-be .  
show:218 show:blurb '''This is a multi-line
literal with many quotes (""""")
and up to two sequential apostrophes ('').'''^^xsd:string .

Note: Previously we were able to parse multi-line literals. But it seems like now we cannot. Check example 3 and example 4.