Hi!

Was there any conclusion to this? Because I am trying to do the same now 
for my Master studies.. I am still in the phase of figuring out how to use 
SAIL api, would be relieving to know there is not a roadblock ahead!

On Wednesday, 23 January 2013 16:33:08 UTC+1, Marcello Leida wrote:
>
> Ciao Luc@
>
> in attachment i put you the source code of the test case, together with 
> the configuration file of the orientDB server and the data i am trying to 
> load.
>
> Hope it can help.
>
> Cheers!
>
> On Tuesday, January 22, 2013 9:56:26 AM UTC+1, Lvc@ wrote:
>>
>> Ciao Marcello,
>> the problem here seems related to the type OrientDB is using to store 
>> relationship: a list but it's supposed to be a set! Now how that can happen?
>>
>> Could you provide me a test case please?
>>
>> Lvc@
>>
>>
>>
>> On 19 January 2013 12:43, Marcello Leida <[email protected]> wrote:
>>
>>> Enter code here...
>>>
>>> Dear all,
>>>
>>> first of all I want to compliment all the OrientDB team for providing 
>>> the community with this amazing tool.
>>> I am new to OrientDB and i started to consider it as an alternative to 
>>> our triple store that we developed internally.
>>> I want to perform some benchmark tests (BSBM benchmark) to see how 
>>> OrientDB performs with RDF and SPARQL.
>>> I understand that since it will use the graph-sail blueprint plug in 
>>> performances will depend from many different factors that may not be 
>>> related to OrientDB team.
>>> However, as said i am trying to upload an RDF file relatively small 
>>> (500k triples).
>>> I am using the 1.3 version of OrientDB and version 2.2 of blueprints and 
>>> related plugins.
>>> I have two types of problems with the blueprint interface.
>>> Firstly it seems that it does not work with the distributed server due 
>>> to lack of atomic transactions (there is a thread also related to this 
>>> problem 
>>> https://groups.google.com/forum/embed/?place=topic%2Forient-database%2FXisDX7F_GH4%2Fdiscussion)
>>>  
>>> and i would like to know if this is something the development team is 
>>> planning to solve.
>>> Second, as said i am trying to load an RDF file using the graph-sail 
>>> blueplrint plugin.
>>> I can connect to the OrientDB and i can submit triples using my 
>>> implementation of the RDFHandler interface.
>>> In order to save memory i commit every 10000 triples and here´s the 
>>> problem... it seems that once i commit i can not insert other triples, 
>>> since the addStatement method returns the following exception.
>>>
>>> I am sure i am doing something wrong but i do not understand where and 
>>> why.
>>>
>>> Here the code i use to connect to the  OrientDB server:
>>>
>>>  OrientGraph graph = null;
>>>  try {
>>>  graph = new OrientGraph("remote:192.168.103.246/testRDF","admin",
>>> "admin");
>>>  
>>>  Sail sail = new GraphSail(graph);
>>>  
>>>  // Initialize the sail store
>>>  sail.initialize();
>>>
>>>
>>>  // Get the sail repository connection
>>>  SailConnection sc = sail.getConnection();
>>>  
>>>  //file to import
>>>  String fileName = "d:\\benchmark\\dataset-500K.nt";
>>>  File dataFile = new File(fileName);
>>>  FileInputStream is = new FileInputStream(dataFile);
>>>  //Create the parser
>>>  RDFParser parser = Rio.createParser(RDFFormat.forFileName(fileName), 
>>> new ValueFactoryImpl());
>>>  // Import the data
>>>  parser.setRDFHandler(new SailRDFHandler(sc));
>>>  parser.parse(is, "file://" + dataFile.getCanonicalPath());
>>>     sc.commit(); 
>>>  //Close the connections
>>>  sc.close();
>>>  sail.shutDown();
>>>  } catch (SailException e) {
>>>  // TODO Auto-generated catch block
>>>  e.printStackTrace();
>>>  }
>>>
>>> and here´s the part of the SailRDFHandler i defined that is giving 
>>> problems:
>>>
>>>  public void handleStatement(Statement arg0) throws RDFHandlerException 
>>> {
>>>  try {
>>>  connection.addStatement(arg0.getSubject(), arg0.getPredicate(),
>>>  arg0.getObject(), arg0.getContext());
>>>  counter++;
>>>  
>>>  if ((counter % 1000) == 0)
>>>  System.out.println("Done "+counter);
>>>  //buffer of 10000 statements before commit
>>>  if ((counter % 10000) == 0)
>>>  connection.commit();
>>>  } catch (SailException e) {
>>>  // TODO Auto-generated catch block
>>>  e.printStackTrace();
>>>  }
>>>  }
>>>
>>> once i commit the first 10000 triples the calls to the 
>>> connection.addStatement method return the following Exception:
>>>
>>> java.lang.ClassCastException: com.orientechnologies.orient.core.db.
>>> record.ORecordLazyList cannot be cast to com.orientechnologies.orient.
>>> core.type.tree.OMVRBTreeRIDSet
>>>  at com.orientechnologies.orient.core.db.graph.OGraphDatabase.
>>> getOutEdges(OGraphDatabase.java:509)
>>>  at com.tinkerpop.blueprints.impls.orient.OrientVertex.getOutEdges(
>>> OrientVertex.java:55)
>>>  at com.tinkerpop.blueprints.impls.orient.OrientVertex.getEdges(
>>> OrientVertex.java:38)
>>>  at com.tinkerpop.blueprints.oupls.sail.GraphBasedMatcher.match(
>>> GraphBasedMatcher.java:54)
>>>  at com.tinkerpop.blueprints.oupls.sail.GraphSailConnection.
>>> removeStatementsInternal(GraphSailConnection.java:293)
>>>  at com.tinkerpop.blueprints.oupls.sail.GraphSailConnection.
>>> addStatementInternal(GraphSailConnection.java:198)
>>>  at com.tinkerpop.blueprints.oupls.sail.GraphSailConnection.
>>> addStatementInternal(GraphSailConnection.java:165)
>>>  at org.openrdf.sail.helpers.SailConnectionBase.addStatement(
>>> SailConnectionBase.java:355)
>>>  at net.neurolabel.graphdb.utils.SailRDFHandler.handleStatement(
>>> SailRDFHandler.java:47)
>>>  at org.openrdf.rio.ntriples.NTriplesParser.parseTriple(NTriplesParser.
>>> java:260)
>>>  at org.openrdf.rio.ntriples.NTriplesParser.parse(NTriplesParser.java:
>>> 170)
>>>  at org.openrdf.rio.ntriples.NTriplesParser.parse(NTriplesParser.java:
>>> 112)
>>>  at net.neurolabel.graphdb.Test.<init>(Test.java:56)
>>>  at net.neurolabel.graphdb.Test.main(Test.java:29)
>>>
>>> hope it is clear enough and thank you in advance.
>>>
>>> Ciao.
>>>
>>>
>>>  -- 
>>>  
>>>  
>>>  
>>>
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to