Browsing rdf data in neo4j

179 views
Skip to first unread message

Alexandre Blanquart

unread,
Jul 21, 2011, 9:50:42 AM7/21/11
to Gremlin-users
Hi,

In my attempt to load my RDF/OWL data in neo4j through blueprints, I
would like to visualize the result : the data in neo4j database,
through the administration web interface. I am able to see the
different nodes or relationships in the data browser with requests
like "node:2" or "rels:2" but I do not know how to request to see a
specific node by giving for example its URI value. Indeed, for now I
have to start from the first node and traverse the graph to search for
this specific node.

Thanks,
Best regards,
Alex

Pierre De Wilde

unread,
Jul 21, 2011, 11:21:59 AM7/21/11
to gremli...@googlegroups.com
Hi Alex,

In Neo4j web admin, you may use the integrated Gremlin to find the node id:

gremlin> g.idx(T.v)[[uri:"http://..."]]

HTH,
Pierre

Le jeudi 21 juillet 2011, Alexandre Blanquart
<alex.bl...@gmail.com> a écrit :

Alexandre Blanquart

unread,
Jul 21, 2011, 11:46:47 AM7/21/11
to Gremlin-users
Hi Pierre,

Thanks for the trick!
Actually the right thing to do is :
gremlin> g.idx(T.v)[[value:"http://..."]]

There are two relationships on URI nodes : value with the URI and kind
with the value to "uri".

Do you append to know the equivalent syntax in the data browser tab of
the web admin?

Regards,
Alex

On 21 juil, 17:21, Pierre De Wilde <pierredewi...@gmail.com> wrote:
> Hi Alex,
>
> In Neo4j web admin, you may use the integrated Gremlin to find the node id:
>
> gremlin> g.idx(T.v)[[uri:"http://..."]]
>
> HTH,
> Pierre
>
> Le jeudi 21 juillet 2011, Alexandre Blanquart
> <alex.blanqu...@gmail.com> a écrit :

Pierre De Wilde

unread,
Jul 21, 2011, 5:20:01 PM7/21/11
to gremli...@googlegroups.com
Hi Alex,

Yep. Human memory is fuzzy.

No idea if equivalent syntax in data browser of Neo4j web admin.

Peter?

Pierre

Le jeudi 21 juillet 2011, Alexandre Blanquart

<alex.bl...@gmail.com> a écrit :

Peter Neubauer

unread,
Jul 21, 2011, 5:22:34 PM7/21/11
to gremli...@googlegroups.com, Jacob hansson

Hi there,
Can't test right now. Will check it with Jake asap.

/peter

Sent from my phone.

Alexandre Blanquart

unread,
Jul 22, 2011, 4:29:41 AM7/22/11
to Gremlin-users
Ok thanks !

Alex

On 21 juil, 23:22, Peter Neubauer <neubauer.pe...@gmail.com> wrote:
> Hi there,
> Can't test right now. Will check it with Jake asap.
>
> /peter
>
> Sent from my phone.
> On Jul 21, 2011 11:20 PM, "Pierre De Wilde" <pierredewi...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Hi Alex,
>
> > Yep. Human memory is fuzzy.
>
> > No idea if equivalent syntax in data browser of Neo4j web admin.
>
> > Peter?
>
> > Pierre
>
> > Le jeudi 21 juillet 2011, Alexandre Blanquart
> > <alex.blanqu...@gmail.com> a écrit :

Peter Neubauer

unread,
Jul 22, 2011, 4:47:35 AM7/22/11
to gremli...@googlegroups.com
Alexandre,
can you make the Neo4j available somewhere, so I can take a look at it?

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org               - Your high performance graph database.
http://startupbootcamp.org/    - Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.

Alexandre Blanquart

unread,
Jul 22, 2011, 9:36:46 AM7/22/11
to Gremlin-users
Hi Peter,

Thanks for the suggestion, unfortunately I am not authorized to do
so :'(

Regards,
Alex

On 22 juil, 10:47, Peter Neubauer <peter.neuba...@neotechnology.com>
wrote:
> Alexandre,
> can you make the Neo4j available somewhere, so I can take a look at it?
>
> Cheers,
>
> /peter neubauer
>
> GTalk:      neubauer.peter
> Skype       peter.neubauer
> Phone       +46 704 106975
> LinkedIn  http://www.linkedin.com/in/neubauer
> Twitter     http://twitter.com/peterneubauer
>
> http://www.neo4j.org              - Your high performance graph database.http://startupbootcamp.org/   - Öresund - Innovation happens HERE.http://www.thoughtmade.com- Scandinavia's coolest Bring-a-Thing party.

Peter Neubauer

unread,
Jul 22, 2011, 10:06:46 AM7/22/11
to gremli...@googlegroups.com

Maybe you have a small example script?

/peter

Sent from my phone.

Alexandre Blanquart

unread,
Jul 22, 2011, 10:41:09 AM7/22/11
to Gremlin-users
I followed Claudio's project here : https://github.com/claudiomartella/dbpedia4neo/,
in order to insert RDF data in neo4j.
I just changed the data by mine.

Alex

On 22 juil, 16:06, Peter Neubauer <neubauer.pe...@gmail.com> wrote:
> Maybe you have a small example script?
>
> /peter
>
> Sent from my phone.
> On Jul 22, 2011 3:36 PM, "Alexandre Blanquart" <alex.blanqu...@gmail.com>
> wrote:
>
>
>
>
>
>
>
> > Hi Peter,
>
> > Thanks for the suggestion, unfortunately I am not authorized to do
> > so :'(
>
> > Regards,
> > Alex
>
> > On 22 juil, 10:47, Peter Neubauer <peter.neuba...@neotechnology.com>
> > wrote:
> >> Alexandre,
> >> can you make the Neo4j available somewhere, so I can take a look at it?
>
> >> Cheers,
>
> >> /peter neubauer
>
> >> GTalk:      neubauer.peter
> >> Skype       peter.neubauer
> >> Phone       +46 704 106975
> >> LinkedIn  http://www.linkedin.com/in/neubauer
> >> Twitter    http://twitter.com/peterneubauer
>
> >>http://www.neo4j.org             - Your high performance graph database.
>
> http://startupbootcamp.org/  - Öresund - Innovation happens HERE.http://www.thoughtmade.com-Scandinavia's coolest Bring-a-Thing party.

Peter Neubauer

unread,
Jul 22, 2011, 4:18:38 PM7/22/11
to gremli...@googlegroups.com
Mmh,
tried http://downloads.dbpedia.org/3.6/de/instance_types_de.nt.bz2 but get

[~/code/dbpedia4neo] $mvn exec:java
-Dexec.mainClass=org.acaro.dbpedia4neo.inserter.DBpediaLoader
-Dexec.args="instance_types_de.nt"
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO] ------------------------------------------------------------------------
[INFO] Building dbpedia4neo
[INFO] task-segment: [exec:java]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default-cli}]
Loading instance_types_de.nt:
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An exception occured while executing the Java class. null

Unexpected end of file
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4 seconds
[INFO] Finished at: Fri Jul 22 22:16:15 CEST 2011
[INFO] Final Memory: 28M/81M
[INFO] ------------------------------------------------------------------------

Which one did you try with?

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org               - Your high performance graph database.

http://startupbootcamp.org/    - Öresund - Innovation happens HERE.

http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.

Alexandre Blanquart

unread,
Jul 25, 2011, 4:22:43 AM7/25/11
to Gremlin-users
Hi Peter,

Sorry for my late answer. Many things to do :-)
I tried with the same file and got the same error.
With the -X option enabled, I found that the file was not correct; the
last line has to be
<http://dbpedia.org/resource/Java> <http://www.w3.org/1999/02/22-rdf-
syntax-ns#type> <http://dbpedia.org/ontology/Island> .
As you will see, the "> ." part should be missing in your file. After
this correction, it should work.

Best regards,
Alex

On 22 juil, 22:18, Peter Neubauer <peter.neuba...@neotechnology.com>
wrote:
> Mmh,
> triedhttp://downloads.dbpedia.org/3.6/de/instance_types_de.nt.bz2but get
> http://www.neo4j.org              - Your high performance graph database.http://startupbootcamp.org/   - Öresund - Innovation happens HERE.http://www.thoughtmade.com- Scandinavia's coolest Bring-a-Thing party.
> >>http://startupbootcamp.org/ - Öresund - Innovation happens HERE.http://www.thoughtmade.com-Scandinavia'scoolest Bring-a-Thing party.

Peter Neubauer

unread,
Jul 25, 2011, 10:45:01 AM7/25/11
to gremli...@googlegroups.com
No problem Alex!

Now, after doing

mvn exec:java -Dexec.mainClass=org.acaro.dbpedia4neo.inserter.DBpediaLoader
-Dexec.args="instance_types_de.nt"


with a statement of
<http://dbpedia.org/resource/Java>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://dbpedia.org/ontology/Island> .

in the file

and accessing the db via

\,,,/
(o o)
-----oOOo-(_)-oOOo-----
gremlin> g = new Neo4jGraph('/Users/peterneubauer/code/dbpedia4neo/dbpedia4neo')
==>neo4jgraph[EmbeddedGraphDatabase
[/Users/peterneubauer/code/dbpedia4neo/dbpedia4neo]]
gremlin> g.V.count()
==>698
gremlin> g.idx(T.v)
==>AUTOMATIC[vertices:class
com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jVertex][autoIndexKeys:null]
gremlin> g.idx(T.v)[[uri:"http://dbpedia.org/resource/Java"]]
gremlin>

Gives me no index hits. This is without anything else. Can you access
and see the indexes in a plain Gremlin shell?

Cheers,

/peter neubauer

GTalk:      neubauer.peter
Skype       peter.neubauer
Phone       +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter      http://twitter.com/peterneubauer

http://www.neo4j.org               - Your high performance graph database.
http://startupbootcamp.org/    - Öresund - Innovation happens HERE.

http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.

Alexandre Blanquart

unread,
Jul 25, 2011, 11:21:59 AM7/25/11
to Gremlin-users
Hi Peter,

There are several problems indeed with the project.
The latter is built against version 0.3 of Blueprints and therefore is
not very up to date. I changed to 0.9-snaphsot all the three
blueprints dependencies in the pom.xml
To avoid another error, add the following line in DBpediaLoader
class :

sail.initialize();

Now, the current Sail has to be initialized.
After that, you can do a mvn --update-snapshots clean install. And
finally try one more time to do load the file with the command:

mvn exec:java -
Dexec.mainClass=org.acaro.dbpedia4neo.inserter.DBpediaLoader -
Dexec.args="instance_types_de.nt"

Then, I started the neo4j server against the relevant location of the
database, to use the gremlin console.
Do not forget, that "value" is the index to use to filter by URIs.
There is no "uri" key on the nodes.
For me, it works now.

Best regards,
Alex

On 25 juil, 16:45, Peter Neubauer <peter.neuba...@neotechnology.com>
wrote:
> http://www.neo4j.org              - Your high performance graph database.http://startupbootcamp.org/   - Öresund - Innovation happens HERE.http://www.thoughtmade.com- Scandinavia's coolest Bring-a-Thing party.
>
> >>http://www.neo4j.org              - Your high performance graph database.http://startupbootcamp.org/  - Öresund - Innovation happens HERE.http://www.thoughtmade.com-Scandinavia's coolest Bring-a-Thing party.
> >> >>http://startupbootcamp.org/ - Öresund - Innovation happens HERE.http://www.thoughtmade.com-Scandinavia'scoolestBring-a-Thing party.
Reply all
Reply to author
Forward
0 new messages