Loading Data
WWKG supports loading RDF data from local files, directories, and remote HTTP sources.
Supported formats
| Format | Extension | MIME type |
|---|---|---|
| Turtle | .ttl | text/turtle |
| N-Triples | .nt | application/n-triples |
| RDF/XML | .rdf | application/rdf+xml |
Load a single file
wwkg load data.ttlBy default the triples are loaded into the default graph. To load into a named graph:
wwkg load data.ttl --graph http://example.org/graph/peopleLoad a directory
When the path is a directory, WWKG recursively loads all .ttl, .nt, and
.rdf files via HTTP PUT, replacing the target graph for each file:
wwkg load ./data/Each file is loaded into a graph derived from the file path. Use --graph-base
to control the IRI prefix:
wwkg load ./data/ --graph-base http://example.org/graphs/With the default --graph-base file://, a file at ./data/people.ttl is loaded
into file://data/people.ttl.
Import via HTTP
For N-Triples files, the import subcommand streams data to a running server:
wwkg client import data.nt --graph http://example.org/graph/peopleTarget a specific branch or workspace
All load commands accept --branch and --workspace:
wwkg load data.ttl --branch staging --workspace urn:wwkg:workspace:550e8400-e29b-41d4-a716-446655440000Target a remote server
By default, wwkg load connects to http://127.0.0.1:4242. Override with
--server:
wwkg load data.ttl --server http://192.168.1.10:4242Verifying loaded data
After loading, run a count query to verify:
wwkg client query "SELECT (COUNT(*) AS ?count) WHERE { ?s ?p ?o }"Or list the named graphs:
wwkg client query "SELECT DISTINCT ?g WHERE { GRAPH ?g { ?s ?p ?o } }"