Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Feb 10, 2023
1 parent 0c2d16c commit e39a5af
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 0 deletions.
Binary file added issue334/.DS_Store
Binary file not shown.
35 changes: 35 additions & 0 deletions issue334/issue334-2-2.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# rdfize an archive (zip) of files.
# parameter values:
# -v zip: zip filename or URL
# -v file: file regexp pattern (default ~.*~)
# sparql-anything -q ../rdfize-zip.sparql -v zip=graphql-2023-01-24.zip > raw-rdf.ttl
# See https://sparql-anything.readthedocs.io/en/latest/Configuration/#from-archive

prefix bsdd: <http://bsdd.buildingsmart.org/def#>
prefix xyz: <http://sparql.xyz/facade-x/data/>
prefix fx: <http://sparql.xyz/facade-x/ns/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

construct {
?s ?p ?o
} where {
service <x-sparql-anything:media-type=application/json> {
service <x-sparql-anything:> {
bind(coalesce(?__file,".*") as ?pattern)
fx:properties fx:location "./issue334-2.tar" .
fx:properties fx:archive.matches ".*\\..*".
[] fx:anySlot ?file
}
# Iter
bind(str(bsdd:) as ?bsdd)
fx:properties fx:namespace ?bsdd.
fx:properties fx:location ?file.
fx:properties fx:from-archive "./issue334-2.tar".
fx:properties fx:use-rdfs-member true.
?s ?p ?o


}
}
34 changes: 34 additions & 0 deletions issue334/issue334-2.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# rdfize an archive (zip) of files.
# parameter values:
# -v zip: zip filename or URL
# -v file: file regexp pattern (default ~.*~)
# sparql-anything -q ../rdfize-zip.sparql -v zip=graphql-2023-01-24.zip > raw-rdf.ttl
# See https://sparql-anything.readthedocs.io/en/latest/Configuration/#from-archive

prefix bsdd: <http://bsdd.buildingsmart.org/def#>
prefix xyz: <http://sparql.xyz/facade-x/data/>
prefix fx: <http://sparql.xyz/facade-x/ns/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

construct {
?s ?p ?o
} where {
# Step 2
service <x-sparql-anything:media-type=application/json> {
# Step 1
service <x-sparql-anything:> {
bind(coalesce(?__file,".*") as ?pattern)
fx:properties fx:location "./issue334.tar" .
fx:properties fx:archive.matches ".*\\.[^\\.]*$".
[] fx:anySlot ?file
}
bind(str(bsdd:) as ?bsdd)
fx:properties fx:namespace ?bsdd.
fx:properties fx:location ?file.
fx:properties fx:from-archive "./issue334.tar".
fx:properties fx:use-rdfs-member true.
?s ?p ?o
}
}
Binary file added issue334/issue334-2.tar
Binary file not shown.
Binary file added issue334/issue334-3.tar
Binary file not shown.
32 changes: 32 additions & 0 deletions issue334/issue334-bugged.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# rdfize an archive (zip) of files.
# parameter values:
# -v zip: zip filename or URL
# -v file: file regexp pattern (default ~.*~)
# sparql-anything -q ../rdfize-zip.sparql -v zip=graphql-2023-01-24.zip > raw-rdf.ttl
# See https://sparql-anything.readthedocs.io/en/latest/Configuration/#from-archive

prefix bsdd: <http://bsdd.buildingsmart.org/def#>
prefix xyz: <http://sparql.xyz/facade-x/data/>
prefix fx: <http://sparql.xyz/facade-x/ns/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

construct {
?s ?p ?o
} where {
service <x-sparql-anything:> {
bind(coalesce(?__file,".*") as ?pattern)
fx:properties fx:location "./issue334.tar" .
fx:properties fx:archive.matches ".*". # This expression is matching also directories
[] fx:anySlot ?file
service <x-sparql-anything:media-type=application/json> {
bind(str(bsdd:) as ?bsdd)
fx:properties fx:namespace ?bsdd.
fx:properties fx:location ?file.
fx:properties fx:from-archive "./issue334.tar".
fx:properties fx:use-rdfs-member true.
?s ?p ?o
}
}
}
32 changes: 32 additions & 0 deletions issue334/issue334-solved.sparql
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# rdfize an archive (zip) of files.
# parameter values:
# -v zip: zip filename or URL
# -v file: file regexp pattern (default ~.*~)
# sparql-anything -q ../rdfize-zip.sparql -v zip=graphql-2023-01-24.zip > raw-rdf.ttl
# See https://sparql-anything.readthedocs.io/en/latest/Configuration/#from-archive

prefix bsdd: <http://bsdd.buildingsmart.org/def#>
prefix xyz: <http://sparql.xyz/facade-x/data/>
prefix fx: <http://sparql.xyz/facade-x/ns/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix xsd: <http://www.w3.org/2001/XMLSchema#>

construct {
?s ?p ?o
} where {
service <x-sparql-anything:> {
bind(coalesce(?__file,".*") as ?pattern)
fx:properties fx:location "./issue334.tar" .
fx:properties fx:archive.matches ".*".
[] fx:anySlot ?file
service <x-sparql-anything:media-type=application/json> {
bind(str(bsdd:) as ?bsdd)
fx:properties fx:namespace ?bsdd.
fx:properties fx:location ?file.
fx:properties fx:from-archive "./issue334.tar".
fx:properties fx:use-rdfs-member true.
?s ?p ?o
}
}
}
Binary file added issue334/issue334.tar
Binary file not shown.
1 change: 1 addition & 0 deletions issue334/test_folder/file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"a":"b", "c":"d"}
1 change: 1 addition & 0 deletions issue334/test_folder/not_empty_folder/file.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"a":"b", "c":"d"}

0 comments on commit e39a5af

Please sign in to comment.