Problems with gremlin

328 views
Skip to first unread message

Omar de Diego

unread,
May 20, 2013, 10:42:29 AM5/20/13
to gremli...@googlegroups.com
Hi guys, i'm trying to put a RDF in Neo4j, and Joshua told me how to do it:

import org.openrdf.rio.RDFFormat;
import org.openrdf.repository.sail.SailRepository;

g = new Neo4jGraph("/tmp/neo");
s = new GraphSail(g);
s.initialize();
r = new SailRepository(s);
rc = r.getConnection();
rc.add(new File("/tmp/myfile.xml"), "", RDFFormat.RDFXML);
rc.close();
s.shutDown();

After doing this i had some problems:

gremlin> g = new Neo4jGraph("/tmp/neo");

==>neo4jgraph[EmbeddedGraphDatabase [\tmp\neo]]

gremlin> s = new GraphSail(g);

==>graphsail[neo4jgraph]

gremlin> s.initialize();

==>null

gremlin> r = new SailRepository(s);

==>graphsail[neo4jgraph]

gremlin> rc = r.getConnection();

==>org.openrdf.repository.sail.SailRepositoryConnection@871fa83

gremlin> rc.add(new File("/tmp/neo.rdf"),"",RDFFormat.RDFXML);

 

20:03:50.823 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.openrdf.rio.n3.N3ParserFactory

20:03:50.827 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.openrdf.rio.ntriples.NTriplesParserFactory

20:03:50.831 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.openrdf.rio.rdfxml.RDFXMLParserFactory

20:03:50.840 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.openrdf.rio.trig.TriGParserFactory

20:03:50.843 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.openrdf.rio.trix.TriXParserFactory

20:03:50.847 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.openrdf.rio.turtle.TurtleParserFactory

20:03:50.852 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class net.fortytwo.sesametools.nquads.NQuadsParserFactory

20:03:50.859 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.semarglproject.sesame.rdf.rdfa.SesameRDFaParserFactory

20:03:50.864 [main] DEBUG org.openrdf.rio.RDFParserRegistry - Registered service

 class org.openrdf.rio.binary.BinaryRDFParserFactory

20:03:50.889 [main] DEBUG org.xml.sax.XMLReader - XMLReader initialized using JA

XP: com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser@3c4f39cd

 

20:03:55.384 [main] WARN  o.o.rio.helpers.ParseErrorLogger - 'http://dbpedia.org

/datatype/second' is not recognized as a supported xsd datatype. (1092, 106)

==>null


Joshua told me that i should do this :

You want is RDFParser.DatatypeHandling.IGORE:


But i don't know how to do it?? Can you help me? 

And the end i need that i can show the graph result in Neo4j, and and new nodes and delete new nodes.

Thanks!! :)

Omar de Diego

unread,
May 23, 2013, 1:51:33 PM5/23/13
to gremli...@googlegroups.com
Hi guys, maybe if i make the problem simple you can help me.

I'm trying to upload this file https://www.dropbox.com/sh/xpwd2bizdyav0r6/XFkSHI1GJi to Neo4j, because i need to see the graph.
I'm trying to do with gremlin. Can you help me?

Thanks!

Marko Rodriguez

unread,
May 23, 2013, 1:57:06 PM5/23/13
to gremli...@googlegroups.com

Omar de Diego

unread,
May 23, 2013, 2:07:53 PM5/23/13
to gremli...@googlegroups.com
Thanks Marko, it works !!

But when i open Neo4j, in localhost and i go to data browser and try to see the graphics representation, i can't see anything.
How can i do it? If i want to add, a new node, or remove one can i do it? 

Thanks again.

Marko Rodriguez

unread,
May 23, 2013, 2:18:44 PM5/23/13
to gremli...@googlegroups.com
Hi Omar,

You might want to learn a bit more about Java/programming before embarking down this road or else it will just be question-answer-question-answer-etc. for sometime to come. In short:

gremlin> g = new SailGraph(new GraphSail(new Neo4jGraph('/tmp/rdf-ex')))
==>sailgraph[graphsail]
gremlin> g.loadRDF('/Users/marko/Desktop/neo.rdf', 'rdf-xml')
==>null
gremlin> g.commit()
==>null

From there you now have RDF data in Neo4j. Now point Neo4j's data browser to the database at /tmp/rdf-ex.


Good luck,
Marko.

Omar de Diego

unread,
May 27, 2013, 10:47:37 AM5/27/13
to gremli...@googlegroups.com
Hi Marko,

I read those web pages, but i'm still lose. Could you tell me other web pages i can read ?
I need to add and remove an element, and see the graphicall representation.

Thanks you.

Omar.


2013/5/23 Marko Rodriguez <okram...@gmail.com>

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/YHPU7TK-1E8/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.

Omar de Diego

unread,
Jun 12, 2013, 12:38:35 PM6/12/13
to gremli...@googlegroups.com
Hi Marko, 

Sorry for disturbe you again, i'm using SailGraph as you told me, first i create a Neo4jGraph into the tmp/rdf-ex, and then move to GraphSail and then i load RDF. The problem is that when i want to see the edges, i see the edges for two files, the one i load sometimes ago and the one i load now that is this one.


And try to understand how it work. Can you tell me a solution? 
As i'm working with GraphSail can i use addEdge to add a new edge? Because i think it's the only solution.

Should i see the rdf representation in databrowser, for the file i load?

I know there is too much questions, i hope you can answer me.

Thank you.

Regards.


2013/5/27 Omar de Diego <omard...@gmail.com>
aseos.rdf
Reply all
Reply to author
Forward
0 new messages