-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
sparql-anything-cli/src/test/java/com/github/sparqlanything/cli/LoadSubdirsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* | ||
* Copyright (c) 2023 SPARQL Anything Contributors @ http://github.com/sparql-anything | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
*/ | ||
|
||
package com.github.sparqlanything.cli; | ||
|
||
import org.junit.Assert; | ||
import org.junit.Test; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
public class LoadSubdirsTest { | ||
public static final Logger L = LoggerFactory.getLogger(LoadSubdirsTest.class); | ||
|
||
@Test | ||
public void test() throws Exception { | ||
String q = getClass().getClassLoader().getResource("count-triples.sparql").toString(); | ||
String d = getClass().getClassLoader().getResource("./load-subdirs").toURI().toString(); | ||
SPARQLAnything sa = new SPARQLAnything(); | ||
String out = sa.callMain(new String[]{ | ||
"-q", q, "-l", d | ||
}); | ||
Assert.assertTrue(out.contains("51")); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
SELECT (COUNT(*) AS ?count) WHERE { graph ?f {?a ?b ?c} } |
3 changes: 3 additions & 0 deletions
3
sparql-anything-cli/src/test/resources/load-subdirs/dir1/dir2/fil2.nt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
_:bn1234 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> . | ||
_:bn1234 <http://schema.org/familyName> "Trump" . | ||
_:bn1234 <http://schema.org/givenName> "Lucy" . |
25 changes: 25 additions & 0 deletions
25
sparql-anything-cli/src/test/resources/load-subdirs/dir1/dir2/file3.jsonld
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"@context": "https://schema.org", | ||
"@type": "Person", | ||
"address": { | ||
"@type": "PostalAddress", | ||
"addressLocality": "Monterotondo", | ||
"addressRegion": "Lazio", | ||
"postalCode": "00010", | ||
"streetAddress": "via Veneto" | ||
}, | ||
"email": "[email protected]", | ||
"jobTitle": "Web Developer", | ||
"name": "Paolo Muti", | ||
"birthPlace": "Philadelphia, PA", | ||
"birthDate": "1979-11-12", | ||
"height": "74 inches", | ||
"gender": "male", | ||
"memberOf": "SS Lazio", | ||
"nationality": "Romanian", | ||
"telephone": "(0039) 339-1024288", | ||
"url": "http://www.example.com", | ||
"sameAs" : [ "https://www.facebook.com/", | ||
"https://www.linkedin.com/", | ||
"http://twitter.com/"] | ||
} |
12 changes: 12 additions & 0 deletions
12
sparql-anything-cli/src/test/resources/load-subdirs/dir1/file1.ttl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>. | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. | ||
@prefix odrl: <http://www.w3.org/ns/odrl/2/>. | ||
@prefix fx: <http://sparql.xyz/facade-x/ns/>. | ||
@prefix xyz: <http://sparql.xyz/facade-x/data/>. | ||
@prefix dct: <http://purl.org/dc/terms/>. | ||
@prefix skos: <http://www.w3.org/2004/02/skos/core#>. | ||
@prefix schema: <http://schema.org/>. | ||
|
||
[ a schema:Person; schema:familyName "Smith"; schema:givenName "John" ] . | ||
[ a schema:Person; schema:familyName "Goldberg"; schema:givenName "Corinna" ] . | ||
|
25 changes: 25 additions & 0 deletions
25
sparql-anything-cli/src/test/resources/load-subdirs/dir1/file2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"@context": "https://schema.org", | ||
"@type": "Person", | ||
"address": { | ||
"@type": "PostalAddress", | ||
"addressLocality": "Monterotondo", | ||
"addressRegion": "Lazio", | ||
"postalCode": "00010", | ||
"streetAddress": "via Veneto" | ||
}, | ||
"email": "[email protected]", | ||
"jobTitle": "Web Master", | ||
"name": "Lucia Malatesta", | ||
"birthPlace": "London, UK", | ||
"birthDate": "1985-01-22", | ||
"height": "70 inches", | ||
"gender": "female", | ||
"memberOf": "SS Roma", | ||
"nationality": "Ungarian", | ||
"telephone": "(0039) 338-1224248", | ||
"url": "http://www.example.com/lucia00123", | ||
"sameAs" : [ "https://www.facebook.com/lucia00123", | ||
"https://www.linkedin.com/lucia00123", | ||
"http://twitter.com/lucia00123"] | ||
} |