Thanks Anday:

here is my new code and I am still getting this warning message:

04:37:02 WARN  riot                      :: Only triples or default graph
data expected : named graph data ignored


String directory = "/Users/adeebnoor/Desktop/Desktop/DDID/UMLStdb";

 Dataset dataset = TDBFactory.createDataset(directory);

 String source = "/Users/adeebnoor/Downloads/Ontologies/umls.trig";

Model m = ModelFactory.createDefaultModel() ;

 System.out.println("start loading");

 RDFDataMgr.read(m,  source);

System.out.println("done loading");

 m.close();

 dataset.close();

Am I doing something wrong?

AdeeB



On Wed, Jul 31, 2013 at 4:21 AM, Andy Seaborne <[email protected]> wrote:

> On 31/07/13 11:11, Adeeb Noor wrote:
>
>> Hi Andy:
>>
>> thanks for the response. Yes my data is in Trig format. But what do you
>> mean by " it take just the default gfraph and loose the rest."
>>
>
> Consider:
> ----------------
> @prefix : <http://example/> .
> { :s :p :o . }
> :g1 { :s1 :p1 :o1 }
> ----------------
>
> that is one triple in the default graph and on triple in the named graph
> :g.
>
> If you call
> RDFDataMgr.read(model,  trig file)
>
> (you don't need to tell the system it's trig if the file extension is
> .trig)
>
> it will read the file and put  :s :p :o . in the model.
>
> :g1 { :s1 :p1 :o1 } is ignored and you get:
>
> ----------------
>
> WARN  riot                 ::
> Only triples or default graph data expected : named graph data ignored
> --------------
>
> Actually, if you call:
>
>         FileManager.get().readModel(m, "D.trig") ;
>
> NB no syntax given, it will read it that way.  You got the error because
> you asked for TriG syntax explicitly.
>
> -----------------
>         Model m = ModelFactory.**createDefaultModel() ;
>         RDFDataMgr.read(m, "D.trig") ;
>         RDFDataMgr.write(System.out, m, Lang.TTL) ;
> -----------------
> 11:17:57 WARN  riot                 :: Only triples or default graph data
> expected : named graph data ignored
>
> @prefix :      <http://example/> .
>
> :s      :p      :o .
> -----------------
>
>
>>
>>
>>
>> On Wed, Jul 31, 2013 at 4:06 AM, Andy Seaborne <[email protected]> wrote:
>>
>>  Jena is fine with TriG.
>>>
>>> You can't load TriG into a model because TriG is a dataset format (many
>>> models).
>>>
>>> Is your data really TriG?
>>>
>>> If you use
>>>
>>>     RDFDataMgr
>>>
>>> to load TriG into a model, (not a dataset), it will BUT it take just the
>>> default gfraph and loose the rest.
>>>
>>> FileManager does to do this.  It is calling modle.read and models
>>> themselves don't support TriG.  It's meaningless.
>>>
>>> For large files use the more efficient bulk loader:
>>>
>>> tdbloader --loc ./tdb FILE.trig
>>>
>>>          Andy
>>>
>>>
>>> On 31/07/13 10:56, Marco Neumann wrote:
>>>
>>>  Ok I see you say tdb2 can't handle Trig? well if so you might want to
>>>> write
>>>> a loader that chunks the data for you before loading it into tdb.
>>>>
>>>>
>>>>
>>>>
>>>> On Wed, Jul 31, 2013 at 5:52 AM, Adeeb Noor <[email protected]>
>>>> wrote:
>>>>
>>>>   Hi Marco:
>>>>
>>>>>
>>>>> Thanks for the response. I am currently using TDB but the problem is
>>>>> as I
>>>>> said my data is around 17G and in Trig format. I never succeed.
>>>>>
>>>>> I cannot use the tdb2 as the file format is Trig. Does that make sense
>>>>> ?
>>>>>
>>>>>
>>>>> On Wed, Jul 31, 2013 at 3:41 AM, Marco Neumann <
>>>>> [email protected]
>>>>>
>>>>>  wrote:
>>>>>>
>>>>>>
>>>>>   try to use the tdb or tdb2 loader instead
>>>>>
>>>>>>
>>>>>>
>>>>>> On Wed, Jul 31, 2013 at 5:39 AM, Adeeb Noor <[email protected]>
>>>>>> wrote:
>>>>>>
>>>>>>   Hi Dave:
>>>>>>
>>>>>>>
>>>>>>> Thanks for the response. Here is my code:
>>>>>>>
>>>>>>> public class testTDB {
>>>>>>>
>>>>>>> public static void main(String[] args) {
>>>>>>>
>>>>>>> String directory = "./tdb";
>>>>>>>
>>>>>>>    Dataset dataset = TDBFactory.createDataset(****directory);
>>>>>>>
>>>>>>>     Model tdb = dataset.getDefaultModel();
>>>>>>>
>>>>>>>    String source = "/Users/adeebnoor/Downloads/****
>>>>>>> Ontologies/umls.trig";
>>>>>>>
>>>>>>>    FileManager.get().readModel(****tdb, source, "TriG" );
>>>>>>>
>>>>>>>
>>>>>>>    tdb.close();
>>>>>>>
>>>>>>>    dataset.close();
>>>>>>>
>>>>>>> }
>>>>>>>
>>>>>>>
>>>>>>> I got this error:
>>>>>>>
>>>>>>> Exception in thread "main"
>>>>>>>
>>>>>>>  com.hp.hpl.jena.shared.****NoReaderForLangException:
>>>>>>
>>>>>>  TriG
>>>>>>>
>>>>>>> at com.hp.hpl.jena.rdf.model.****impl.RDFReaderFImpl.getReader(
>>>>>>> RDFReaderFImpl.java:100)
>>>>>>>
>>>>>>> at com.hp.hpl.jena.rdf.model.****impl.ModelCom.read(ModelCom.****
>>>>>>> java:276)
>>>>>>>
>>>>>>> at
>>>>>>>
>>>>>>>  com.hp.hpl.jena.util.****FileManager.readModelWorker(**
>>>>>>
>>>>> FileManager.java:403)
>>>>>
>>>>>
>>>>>>  at com.hp.hpl.jena.util.****FileManager.readModel(**
>>>>>>> FileManager.java:342)
>>>>>>>
>>>>>>>    at ddid.testTDB.main(testTDB.****java:19)
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Then I remove the Trig string pramater from the Filemangager method:
>>>>>>> FileManager.get().readModel(****tdb, source );
>>>>>>>
>>>>>>>
>>>>>>> and the program seems to be running and taking the whole memory but I
>>>>>>>
>>>>>>>  got
>>>>>>
>>>>>
>>>>>  this warning message:
>>>>>>
>>>>>>>
>>>>>>> 03:37:31 WARN  riot                      :: Only triples or default
>>>>>>>
>>>>>>>  graph
>>>>>>
>>>>>
>>>>>  data expected : named graph data ignored
>>>>>>
>>>>>>>
>>>>>>> After waiting the program to finish I check it the TDB and there was
>>>>>>> nothing on it.
>>>>>>>
>>>>>>> what do you think.
>>>>>>>
>>>>>>> Thanks
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Wed, Jul 31, 2013 at 2:17 AM, Dave Reynolds <
>>>>>>>
>>>>>>>  [email protected]
>>>>>>
>>>>>>  wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>   On 31/07/13 00:09, Adeeb Noor wrote:
>>>>>>>
>>>>>>>>
>>>>>>>>   Hi All:
>>>>>>>>
>>>>>>>>>
>>>>>>>>> I have a trig file (rdf) that is sized 17GB, I was wondering if
>>>>>>>>> Jena
>>>>>>>>>
>>>>>>>>>  has
>>>>>>>>
>>>>>>>
>>>>>>  triple store that can load this data. I know that Jena supports trig
>>>>>>>
>>>>>>>> format
>>>>>>>>> but I am not sure about the size-wise.
>>>>>>>>>
>>>>>>>>> If not, can you point me out to a free triple store that is
>>>>>>>>>
>>>>>>>>>  compatible
>>>>>>>>
>>>>>>>
>>>>>  with
>>>>>>
>>>>>>> Jene as my project structure is based all on Jena.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  I would have thought you could load that in to TDB just fine.  I
>>>>>>>>
>>>>>>>>  would
>>>>>>>
>>>>>>
>>>>>  guess that to be around 100m triples.
>>>>>>
>>>>>>>
>>>>>>>> Dave
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>> --
>>>>>>> Adeeb Noor
>>>>>>> Ph.D. Candidate
>>>>>>> Dept of Computer Science
>>>>>>> University of Colorado at Boulder
>>>>>>> Cell: 571-484-3303
>>>>>>> Email: [email protected]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> --
>>>>>>
>>>>>>
>>>>>> ---
>>>>>> Marco Neumann
>>>>>> KONA
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Adeeb Noor
>>>>> Ph.D. Candidate
>>>>> Dept of Computer Science
>>>>> University of Colorado at Boulder
>>>>> Cell: 571-484-3303
>>>>> Email: [email protected]
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>
>>
>>
>


-- 
Adeeb Noor
Ph.D. Candidate
Dept of Computer Science
University of Colorado at Boulder
Cell: 571-484-3303
Email: [email protected]

Reply via email to