Graph Selection When Loading Quads
When loading quads, you can use the following command line options to control the graph into which your quads are loaded:
-output_graph
-output_override_graph
-output_collections
You can use -output_collections
by itself or with the other two options. You cannot use -output_graph
and -output_override_graph
together.
If your semantic data is not in a quad format like N-Quads, see Graph Selection for Other Triple Types.
Quads interact with these options differently than other triple formats because quads can include a graph IRI in each quad. The following table summarizes the effect of various option combinations when importing quads with mlcp:
Graph Options |
Description |
---|---|
none |
For quads that contain an explicit graph IRI, load the triple into that graph. For quads with no explicit graph IRI, load the triple into the default graph. The default graph URI is |
|
For quads that contain an explicit graph IRI, load the triple into that graph. For quads with no explicit graph IRI, load the triple into the graph specified by -output_graph. |
|
Load all triples into the graph specified by |
|
Similar to |
|
For quads that contain an explicit graph IRI, load the triple into that graph. For quads with no explicit graph IRI, load the triple into the graph specified by |
|
Load all triples into the graph specified by |
For more details, see Loading Triples with mlcp in the Semantic Graph Developer’s Guide.
For example, suppose you load the following N-Quad data with mlcp. There are 3 quads in the data set. The first and last quad include a graph IRI, the second quad does not.
<http://one.example/subject1> <http://one.example/predicate1> <http://one.example/object1> <http://example.org/graph3> . _:subject1 <http://an.example/predicate1> "object1" . _:subject2 <http://an.example/predicate2> "object2" <http://example.org/graph5> .
If you use a command similar to the following load the data:
# Windows users, see Modifying the Example Commands for Windows $ mlcp.sh import -username user -password password -host localhost \ -port 8000 -input_file_path /my/data.nq -mode local \ -input_file_type rdf
Then the table below illustrates how the various graph related options affect how the triples are loaded into the database:
Graph Options |
Result |
---|---|
none |
Graphs:
|
|
Graphs:
|
|
Graphs: |
|
Graphs: |
|
Graphs:
All triples also added to collections |
|
Graphs: |