Re: [Neo4j] Question: Neo4j and semantic-mediawiki
Hi Alfredas, One thing I forgot to mention. You can express pattern match queries in Gremlin: https://github.com/tinkerpop/gremlin/wiki/SPARQL-vs.-Gremlin While not having the same syntax, you can still do pattern matching as a traversal. But yes, I ultimately want to get an extension to Gremlin that provides a more SPARQL look-and-feel for property graphs. Just a heads up, Marko. http://markorodriguez.com On Feb 22, 2011, at 10:24 AM, Alfredas Chmieliauskas wrote: Well I'm in general interested in having all these different mechanisms (native (traverse), pipes, gremlin, sparql) to query the same graph. That would give so much more flexibility when writing domain methods. Ideally you would not want to write domain methods at all, but annotate interfaces with some queries, something like: interface PersonRepository { @SparqlQuery(query=where {?p foaf:knows ??person . }) public ListPerson findMyFriends(Person person); @GremlinQuery(query=person.bothE('foaf:knows').bothV.except([person])) public ListPerson findMyFriends2(Person person); } That would be quite great, but thats of course a bit more JPA inspired approach and many other useful roads can be taken... Alfredas On Tue, Feb 22, 2011 at 6:03 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, Got it. It would be great to be able to use Sparql on neo4j or any other Blueprint db. Yea it would. Do you think it would be possible to map/translate sparql query to gremlin/pipes? I plan to create a new DSL over Gremlin/Pipes that has a syntax flavor like this. E.g. x = []; y = [] g.select(x, y).where( g.v('marko').outE('knows').inV.var(x) var(x).outE('knows').inV.var(y)) EQUIVALENT TO: SELECT ?x, ?y WHERE { marko knows ?x ?x knows ?y } In short, traversal-based SPARQL (similar to the SPARQL engine developed by Neo4j). The benefits is that a line is property graph-based, not restricted to RDF graphs only. E.g. x = []; y = [] g.select(x, y).where( g.v('marko').outE('knows').inV.var(x) var(x).outE('knows').inV{it.age 30}.var(y)) I haven't gotten to starting this project yet, but if anyone is interested in helping, that would be great. Thanks, Marko. http://markorodriguez.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
[Neo4j] Question: Neo4j and semantic-mediawiki
Hi all! Recently I started exploring things about graph databases in conjunction with knowledge management and have run across the Neo4j. It now seems to me that Neo4j can somehow be used with the semantic-mediawiki to store RDF and quiery Neo4j with SPARQL. Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any resources worth reading? If so, could someone please point me to such resources?.. PS: Sorry for newbie question, of course. Dmitry N. Medvedev, Tel.: +7 916.795.1839 E-mail: dmitry.medve...@gmail.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Question: Neo4j and semantic-mediawiki
There is a rdf-sparql component to Neo4j that could in theory be configured to be used as a backend for semantic mediawiki. But you still have better chances to configure smw to use a triplestore http://en.wikipedia.org/wiki/Triplestore For more info see: http://www.mediawiki.org/wiki/Extension:SparqlExtension Alfredas 2011/2/22 Дмитрий Медведев dmitry.medve...@gmail.com: Hi all! Recently I started exploring things about graph databases in conjunction with knowledge management and have run across the Neo4j. It now seems to me that Neo4j can somehow be used with the semantic-mediawiki to store RDF and quiery Neo4j with SPARQL. Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any resources worth reading? If so, could someone please point me to such resources?.. PS: Sorry for newbie question, of course. Dmitry N. Medvedev, Tel.: +7 916.795.1839 E-mail: dmitry.medve...@gmail.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Question: Neo4j and semantic-mediawiki
This looks great. I've encountered a problem when following the example. Here I'm trying to create a sail out of Neo4jGraph. java.lang.RuntimeException: No such index exists: edges at com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.getIndex(Neo4jGraph.java:113) at com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:88) at com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:66) Any ideas? Thanks, Alfredas On Tue, Feb 22, 2011 at 4:17 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any resources worth reading? If so, could someone please point me to such resources?.. There is a 1-to-1 RDF mapper in Blueprints. It turns any Blueprints GraphDB into a Sail-based RDF triple/quad store. Given the 1-to-1 nature, you can work with your data from the perspective of the Blueprints API, Sail API, or Neo4j API. https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation Through Sail you can do SPARQL, SeRQL, RQL, and Gremlin. See ya, Marko. http://markorodriguez.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Question: Neo4j and semantic-mediawiki
Hi, I apologize. When I said 1-to-1, I spoke with exaggeration. You will need to create a GraphSail from a blank Neo4jGraph initially. Sail sail = new GraphSail(new Neo4jGraph(/tmp/neo4jgraphsail)) At that point, you can move back and forth. The reason being, GraphSail requires indices that are appropriate for efficient statement/SPARQL type queries. Moreover, you can't simply take a Neo4jGraph that you already have an make it an RDF triple/quad store. This is because RDF requires URIs, blank nodes, and literals for it to work -- thus, arbitrary properties on a graph are not allowed through Sail. So, 1-to-1 should read: Once you have created a GraphSail, you can GraphSail.getGraph() to work with your graph using native APIs. Apologies for the confusion, Marko. http://markorodriguez.com On Feb 22, 2011, at 10:01 AM, Alfredas Chmieliauskas wrote: This looks great. I've encountered a problem when following the example. Here I'm trying to create a sail out of Neo4jGraph. java.lang.RuntimeException: No such index exists: edges at com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.getIndex(Neo4jGraph.java:113) at com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:88) at com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:66) Any ideas? Thanks, Alfredas On Tue, Feb 22, 2011 at 4:17 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any resources worth reading? If so, could someone please point me to such resources?.. There is a 1-to-1 RDF mapper in Blueprints. It turns any Blueprints GraphDB into a Sail-based RDF triple/quad store. Given the 1-to-1 nature, you can work with your data from the perspective of the Blueprints API, Sail API, or Neo4j API. https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation Through Sail you can do SPARQL, SeRQL, RQL, and Gremlin. See ya, Marko. http://markorodriguez.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Question: Neo4j and semantic-mediawiki
Got it. It would be great to be able to use Sparql on neo4j or any other Blueprint db. Do you think it would be possible to map/translate sparql query to gremlin/pipes? Alfredas On Tue, Feb 22, 2011 at 5:09 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, I apologize. When I said 1-to-1, I spoke with exaggeration. You will need to create a GraphSail from a blank Neo4jGraph initially. Sail sail = new GraphSail(new Neo4jGraph(/tmp/neo4jgraphsail)) At that point, you can move back and forth. The reason being, GraphSail requires indices that are appropriate for efficient statement/SPARQL type queries. Moreover, you can't simply take a Neo4jGraph that you already have an make it an RDF triple/quad store. This is because RDF requires URIs, blank nodes, and literals for it to work -- thus, arbitrary properties on a graph are not allowed through Sail. So, 1-to-1 should read: Once you have created a GraphSail, you can GraphSail.getGraph() to work with your graph using native APIs. Apologies for the confusion, Marko. http://markorodriguez.com On Feb 22, 2011, at 10:01 AM, Alfredas Chmieliauskas wrote: This looks great. I've encountered a problem when following the example. Here I'm trying to create a sail out of Neo4jGraph. java.lang.RuntimeException: No such index exists: edges at com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph.getIndex(Neo4jGraph.java:113) at com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:88) at com.tinkerpop.blueprints.pgm.oupls.sail.GraphSail.init(GraphSail.java:66) Any ideas? Thanks, Alfredas On Tue, Feb 22, 2011 at 4:17 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, Did anyone have any experience with Neo4j + RDF + SPARQL? Or are there any resources worth reading? If so, could someone please point me to such resources?.. There is a 1-to-1 RDF mapper in Blueprints. It turns any Blueprints GraphDB into a Sail-based RDF triple/quad store. Given the 1-to-1 nature, you can work with your data from the perspective of the Blueprints API, Sail API, or Neo4j API. https://github.com/tinkerpop/blueprints/wiki/Sail-Ouplementation Through Sail you can do SPARQL, SeRQL, RQL, and Gremlin. See ya, Marko. http://markorodriguez.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Question: Neo4j and semantic-mediawiki
Hi, Got it. It would be great to be able to use Sparql on neo4j or any other Blueprint db. Yea it would. Do you think it would be possible to map/translate sparql query to gremlin/pipes? I plan to create a new DSL over Gremlin/Pipes that has a syntax flavor like this. E.g. x = []; y = [] g.select(x, y).where( g.v('marko').outE('knows').inV.var(x) var(x).outE('knows').inV.var(y)) EQUIVALENT TO: SELECT ?x, ?y WHERE { marko knows ?x ?x knows ?y } In short, traversal-based SPARQL (similar to the SPARQL engine developed by Neo4j). The benefits is that a line is property graph-based, not restricted to RDF graphs only. E.g. x = []; y = [] g.select(x, y).where( g.v('marko').outE('knows').inV.var(x) var(x).outE('knows').inV{it.age 30}.var(y)) I haven't gotten to starting this project yet, but if anyone is interested in helping, that would be great. Thanks, Marko. http://markorodriguez.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user
Re: [Neo4j] Question: Neo4j and semantic-mediawiki
Well I'm in general interested in having all these different mechanisms (native (traverse), pipes, gremlin, sparql) to query the same graph. That would give so much more flexibility when writing domain methods. Ideally you would not want to write domain methods at all, but annotate interfaces with some queries, something like: interface PersonRepository { @SparqlQuery(query=where {?p foaf:knows ??person . }) public ListPerson findMyFriends(Person person); @GremlinQuery(query=person.bothE('foaf:knows').bothV.except([person])) public ListPerson findMyFriends2(Person person); } That would be quite great, but thats of course a bit more JPA inspired approach and many other useful roads can be taken... Alfredas On Tue, Feb 22, 2011 at 6:03 PM, Marko Rodriguez okramma...@gmail.com wrote: Hi, Got it. It would be great to be able to use Sparql on neo4j or any other Blueprint db. Yea it would. Do you think it would be possible to map/translate sparql query to gremlin/pipes? I plan to create a new DSL over Gremlin/Pipes that has a syntax flavor like this. E.g. x = []; y = [] g.select(x, y).where( g.v('marko').outE('knows').inV.var(x) var(x).outE('knows').inV.var(y)) EQUIVALENT TO: SELECT ?x, ?y WHERE { marko knows ?x ?x knows ?y } In short, traversal-based SPARQL (similar to the SPARQL engine developed by Neo4j). The benefits is that a line is property graph-based, not restricted to RDF graphs only. E.g. x = []; y = [] g.select(x, y).where( g.v('marko').outE('knows').inV.var(x) var(x).outE('knows').inV{it.age 30}.var(y)) I haven't gotten to starting this project yet, but if anyone is interested in helping, that would be great. Thanks, Marko. http://markorodriguez.com ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user ___ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user