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 |
Upload a single file
wwkg graph upload data.ttlBy default the triples are loaded into the default graph. To load into a named graph:
wwkg graph upload data.ttl --graph http://example.org/graph/peopleUpload 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 graph upload ./data/Each file is loaded into a graph derived from the file path. Use --graph-base
to control the IRI prefix:
wwkg graph upload ./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.
Target a specific branch or workspace
Upload accepts --workspace; --target-branch controls the final merge target:
wwkg graph upload data.ttl --target-branch staging --workspace urn:wwkg:workspace:550e8400-e29b-41d4-a716-446655440000Target a remote server
By default, wwkg graph upload connects to the local node. Override the node target
with the global connection flags:
wwkg --ticket <endpoint-ticket> upload data.ttlVerifying loaded data
After loading, run a count query to verify:
wwkg graph query "SELECT (COUNT(*) AS ?count) WHERE { ?s ?p ?o }"Or list the named graphs:
wwkg graph query "SELECT DISTINCT ?g WHERE { GRAPH ?g { ?s ?p ?o } }"