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 List<Person> findMyFriends(Person person);
> 
> @GremlinQuery(query="person.bothE('foaf:knows').bothV.except([person])")
> public List<Person> 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

Reply via email to