You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Wang Dongsheng <ds...@gmail.com> on 2013/10/18 04:06:19 UTC

How to import large TTL file into named graph into TDB?

HI,
  It's good to use
TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(datasetGraph),file,
false); to load large TTL files into TDB.
   But, I want to name the graph, maybe something liked
"dataset.addNamedModel(graphName, Model)"  As we know, this method is
slow and limited to fast and large file importing.
   Is there any similar function for the TDBLoader cass that I can
name a graphName?

Thanks in advance~!

Re: How to import large TTL file into named graph into TDB?

Posted by Andy Seaborne <an...@apache.org>.
On 19/10/13 14:34, Wang Dongsheng wrote:
> Wow~ This is cool~
>   I understand the slots as something like a "N4" format instead of
> "N3" triple, isn't it? For example, "<g> <s> <p> <o>", like the four
> parameters in query "Select * from {?g {?s ?p ?o}}"  ??

That's an implementation way of looking at it.

A dataset is a set of a graph (the default graph) and pairs (IRI, graph).

A GraphTDB is actually a view of the database - either of the triple 
table (default graph) or setting the graph name slot in a quad (named 
graph).

SELECT * {
  { ?s ?p ?o } UNION { GRAPH ?g {?s ?p ?o}}
}

You can also choose to make the default graph seen by the query equal to 
the union of the named graphs.

	Andy

>
> Thank you so much~
>
> On Fri, Oct 18, 2013 at 10:10 PM, Andy Seaborne <an...@apache.org> wrote:
>> On 18/10/13 09:24, Wang Dongsheng wrote:
>>>
>>> Then there is no way to give a name when load the data in java code?
>>
>>
>> Graphs/model don't have names - the slots in the dataset has the name. The
>> same graph can be in a dataset multiple times.
>>
>> Model m = dataset.getNamedModel(...)
>> GraphTDB g = (GraphTDB)m.getGraph()
>> TDBLoader.load(g,....)
>>
>> loads into a named graph of the dataset
>>
>>          Andy
>>
>>
>>>
>>> Anyway, thank you for answering! It helps too :)
>>>
>>> On Fri, Oct 18, 2013 at 3:38 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>
>>>> On 18/10/13 03:06, Wang Dongsheng wrote:
>>>>>
>>>>>
>>>>> HI,
>>>>>      It's good to use
>>>>> TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(datasetGraph),file,
>>>>> false); to load large TTL files into TDB.
>>>>>       But, I want to name the graph, maybe something liked
>>>>> "dataset.addNamedModel(graphName, Model)"  As we know, this method is
>>>>> slow and limited to fast and large file importing.
>>>>>       Is there any similar function for the TDBLoader cass that I can
>>>>> name a graphName?
>>>>>
>>>>> Thanks in advance~!
>>>>>
>>>>
>>>>
>>>>
>>>> TDBLoader.load(GraphTDB,....)
>>>>
>>>> If you just want to load the data, it's easier to do it from the command
>>>> line with "tdbloader --graph=IRI"
>>>>
>>>>           Andy
>>>>
>>


Re: How to import large TTL file into named graph into TDB?

Posted by Wang Dongsheng <ds...@gmail.com>.
Wow~ This is cool~
 I understand the slots as something like a "N4" format instead of
"N3" triple, isn't it? For example, "<g> <s> <p> <o>", like the four
parameters in query "Select * from {?g {?s ?p ?o}}"  ??

Thank you so much~

On Fri, Oct 18, 2013 at 10:10 PM, Andy Seaborne <an...@apache.org> wrote:
> On 18/10/13 09:24, Wang Dongsheng wrote:
>>
>> Then there is no way to give a name when load the data in java code?
>
>
> Graphs/model don't have names - the slots in the dataset has the name. The
> same graph can be in a dataset multiple times.
>
> Model m = dataset.getNamedModel(...)
> GraphTDB g = (GraphTDB)m.getGraph()
> TDBLoader.load(g,....)
>
> loads into a named graph of the dataset
>
>         Andy
>
>
>>
>> Anyway, thank you for answering! It helps too :)
>>
>> On Fri, Oct 18, 2013 at 3:38 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>> On 18/10/13 03:06, Wang Dongsheng wrote:
>>>>
>>>>
>>>> HI,
>>>>     It's good to use
>>>> TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(datasetGraph),file,
>>>> false); to load large TTL files into TDB.
>>>>      But, I want to name the graph, maybe something liked
>>>> "dataset.addNamedModel(graphName, Model)"  As we know, this method is
>>>> slow and limited to fast and large file importing.
>>>>      Is there any similar function for the TDBLoader cass that I can
>>>> name a graphName?
>>>>
>>>> Thanks in advance~!
>>>>
>>>
>>>
>>>
>>> TDBLoader.load(GraphTDB,....)
>>>
>>> If you just want to load the data, it's easier to do it from the command
>>> line with "tdbloader --graph=IRI"
>>>
>>>          Andy
>>>
>

Re: How to import large TTL file into named graph into TDB?

Posted by Andy Seaborne <an...@apache.org>.
On 18/10/13 09:24, Wang Dongsheng wrote:
> Then there is no way to give a name when load the data in java code?

Graphs/model don't have names - the slots in the dataset has the name. 
The same graph can be in a dataset multiple times.

Model m = dataset.getNamedModel(...)
GraphTDB g = (GraphTDB)m.getGraph()
TDBLoader.load(g,....)

loads into a named graph of the dataset

	Andy

>
> Anyway, thank you for answering! It helps too :)
>
> On Fri, Oct 18, 2013 at 3:38 PM, Andy Seaborne <an...@apache.org> wrote:
>> On 18/10/13 03:06, Wang Dongsheng wrote:
>>>
>>> HI,
>>>     It's good to use
>>> TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(datasetGraph),file,
>>> false); to load large TTL files into TDB.
>>>      But, I want to name the graph, maybe something liked
>>> "dataset.addNamedModel(graphName, Model)"  As we know, this method is
>>> slow and limited to fast and large file importing.
>>>      Is there any similar function for the TDBLoader cass that I can
>>> name a graphName?
>>>
>>> Thanks in advance~!
>>>
>>
>>
>>
>> TDBLoader.load(GraphTDB,....)
>>
>> If you just want to load the data, it's easier to do it from the command
>> line with "tdbloader --graph=IRI"
>>
>>          Andy
>>


Re: How to import large TTL file into named graph into TDB?

Posted by Wang Dongsheng <ds...@gmail.com>.
Then there is no way to give a name when load the data in java code?

Anyway, thank you for answering! It helps too :)

On Fri, Oct 18, 2013 at 3:38 PM, Andy Seaborne <an...@apache.org> wrote:
> On 18/10/13 03:06, Wang Dongsheng wrote:
>>
>> HI,
>>    It's good to use
>> TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(datasetGraph),file,
>> false); to load large TTL files into TDB.
>>     But, I want to name the graph, maybe something liked
>> "dataset.addNamedModel(graphName, Model)"  As we know, this method is
>> slow and limited to fast and large file importing.
>>     Is there any similar function for the TDBLoader cass that I can
>> name a graphName?
>>
>> Thanks in advance~!
>>
>
>
>
> TDBLoader.load(GraphTDB,....)
>
> If you just want to load the data, it's easier to do it from the command
> line with "tdbloader --graph=IRI"
>
>         Andy
>

Re: How to import large TTL file into named graph into TDB?

Posted by Andy Seaborne <an...@apache.org>.
On 18/10/13 03:06, Wang Dongsheng wrote:
> HI,
>    It's good to use
> TDBLoader.load(TDBInternal.getBaseDatasetGraphTDB(datasetGraph),file,
> false); to load large TTL files into TDB.
>     But, I want to name the graph, maybe something liked
> "dataset.addNamedModel(graphName, Model)"  As we know, this method is
> slow and limited to fast and large file importing.
>     Is there any similar function for the TDBLoader cass that I can
> name a graphName?
>
> Thanks in advance~!
>



TDBLoader.load(GraphTDB,....)

If you just want to load the data, it's easier to do it from the command 
line with "tdbloader --graph=IRI"

	Andy