1. We have modeled/represented our Neo4j data as RDF triples. In contrast to Cypher, I know that SPARQL is designed for RDF stores. Is that enough of an argument to choose SPARQL over Cypher as my go-to query language for my database? Or can Cypher accomplish everything SPARQL can, just not with as much dexterity and/or ease? I assume SPARQL cannot be used with a non-RDF store, so it would not work the other way around.
2. I read a FAQ blog on Neo4j which stated that "You can use Neo4j as an RDF store, and then run SPARQL queries against it, by using TinkerPop". Does that mean that SPARQL can only be used on the Embedded Neo4j only, since other Tinkerpop products (i.e. Blueprints) require the embedded server? By the way, we are using Neo4j Server (i.e. REST APIs), not the Embedded Server.
> 2. I read a FAQ blog on Neo4j which stated that "You can use Neo4j as an RDF store, and then run SPARQL queries against it, by using TinkerPop". Does that mean that SPARQL can only be used on the Embedded Neo4j only, since other Tinkerpop products (i.e. Blueprints) require the embedded server? By the way, we are using Neo4j Server (i.e. REST APIs), not the Embedded Server.
Neo4j Server simply wraps Neo4j embedded. As such, you can use GraphSail over Neo4j and thus achieve SPARQL over Neo4j.
Any thoughts/opinions on using SPARQL over Cypher? My thought is that since Cypher is a proprietary Neo4j query language, I would want to use Cypher over SPARQL. But if it's smarter to use SPARQL over Cypher for a RDF store, then I would rather use SPARQL.
Hi there,
yes, Cypher is closer to the metal. OTOH, RDF is more established if
you deal with Linked Data. Not really sure what you want. How much RDF
querying do you need? Can you express your queries in Cypher? In that
case, I would choose the latter.
On Tue, Sep 11, 2012 at 12:32 AM, ASrivastav <asrivas...@identropy.com> wrote:
> I appreciate the quick response Marko!
> Any thoughts/opinions on using SPARQL over Cypher? My thought is that since
> Cypher is a proprietary Neo4j query language, I would want to use Cypher
> over SPARQL. But if it's smarter to use SPARQL over Cypher for a RDF store,
> then I would rather use SPARQL.
> Any thoughts/opinions on using SPARQL over Cypher? My thought is that
> since Cypher is a proprietary Neo4j query language, I would want to use
> Cypher over SPARQL. But if it's smarter to use SPARQL over Cypher for a
> RDF store, then I would rather use SPARQL.
As with any language selection it is a lot about what you are trying to express. SPARQL is more oriented towards full database scanning and matching, whereas Cypher generally wants you to know of a starting point and work from there. I think this will change over time though, as the indexing in Neo improves, so that you basically don't have to think about "start points" anymore. SPARQL is also read-only by design, so if you want mutating operations Cypher is the only choice.
Thanks for the helpful responses, Peter and Rickard.
To be honest, we want our data stored in RDF format but we don't necessarily need to retrieve the data via RDF querying. Also, we definitely need to execute CRUD-type operations, so if SPARQL is read-only by design, then that eliminates itself.
I feel much better about the decision to go with a REST API + Cypher solution for our Neo4j Server. It provides maximum security plus I can use Cypher to query, insert, update and delete data in my graph.
I appreciate all of the help in making this decision. Thanks.
On Monday, September 10, 2012 8:14:30 PM UTC-5, Rickard Öberg wrote:
> On 9/11/12 06:32 , ASrivastav wrote: > > I appreciate the quick response Marko!
> > Any thoughts/opinions on using SPARQL over Cypher? My thought is that > > since Cypher is a proprietary Neo4j query language, I would want to use > > Cypher over SPARQL. But if it's smarter to use SPARQL over Cypher for a > > RDF store, then I would rather use SPARQL.
> As with any language selection it is a lot about what you are trying to > express. SPARQL is more oriented towards full database scanning and > matching, whereas Cypher generally wants you to know of a starting point > and work from there. I think this will change over time though, as the > indexing in Neo improves, so that you basically don't have to think > about "start points" anymore. SPARQL is also read-only by design, so if > you want mutating operations Cypher is the only choice.
Hi there,
yes, Cypher is closer to the metal. OTOH, RDF is more established if you
deal with Linked Data. Not really sure what you want. How much RDF querying
do you need? Can you express your queries in
> Any thoughts/opinions on using SPARQL over Cypher? My thought is that
since
> Cypher is a proprietary Neo4j query language, I would want to use Cypher
> over SPARQL. But if it's smarter to use SPARQL over Cypher for a RDF
store,
> then I would rather use SPARQL.
On Monday, September 10, 2012 9:14:30 PM UTC-4, Rickard Öberg wrote:
> On 9/11/12 06:32 , ASrivastav wrote: > > I appreciate the quick response Marko!
> > Any thoughts/opinions on using SPARQL over Cypher? My thought is that > > since Cypher is a proprietary Neo4j query language, I would want to use > > Cypher over SPARQL. But if it's smarter to use SPARQL over Cypher for a > > RDF store, then I would rather use SPARQL.
> As with any language selection it is a lot about what you are trying to > express. SPARQL is more oriented towards full database scanning and > matching, whereas Cypher generally wants you to know of a starting point > and work from there. I think this will change over time though, as the > indexing in Neo improves, so that you basically don't have to think > about "start points" anymore. SPARQL is also read-only by design, so if > you want mutating operations Cypher is the only choice.
This last statement is totally not true. SPARQL 1.1 has a fully defined update API that works like SQL DDL/DML that allows inline updates on live graphs.
> This last statement is totally not true. SPARQL 1.1 has a fully defined
> update API that works like SQL DDL/DML that allows inline updates on
> live graphs.
The SPARQL Query language, which is what Neo4j supports, is read-only. The SPARQL 1.1 Update language is separate from the former, and adds updates, but AFAIK there are no plugins in Neo4j to support it (the SPARQLPlugin doesn't anyway).
Agreed, but your statement 'SPARQL is also read-only by design' doesnt provide either the context or clarification that it's specific to Neo4j's current capabilities, and not the standard itself.
On Wednesday, October 31, 2012 10:03:06 PM UTC-4, Rickard Öberg wrote:
> On 11/1/12 06:09 , Venkat Krishnamurthy wrote: > > This last statement is totally not true. SPARQL 1.1 has a fully defined > > update API that works like SQL DDL/DML that allows inline updates on > > live graphs.
> The SPARQL Query language, which is what Neo4j supports, is read-only. > The SPARQL 1.1 Update language is separate from the former, and adds > updates, but AFAIK there are no plugins in Neo4j to support it (the > SPARQLPlugin doesn't anyway).