0

I would like to ask your insights about the real world use cases or examples that why we need to query on predicate in a dataset without specifying other elements (e.g., the value of subjet, the value of object) in the query. The objective is to demonstrate that the query interface should natively support this query pattern upon graph based database.

One of my example is that in a smart city scenario, where we want to query all areas in a city that are monitored by devices. The areas can be streets, buildings, parks, etc, while the devices can be webcams, sniffers, etc. So the query can be formalized as something like

SELECT  ?s ?o
WHERE
   {  ?s ont:monitoredBy ?o
} LIMIT 50

Do you have any other examples to show the real use of this kind of queries? The goal is to collect several representative examples and convince people in the management level who are not data management experts at all. Thanks a lot for your feedback.

  • Real use-cases? Each time you're interested in data related via a given predicate. I mean, this can be anything, I don't what you want to here now. By the way, the variable `?predicate` is not bound in your query... – UninformedUser Jun 19 '18 at 17:36
  • Examples are infinite. And what is the point to post it on StackOverflow? – Gilles-Antoine Nys Jun 20 '18 at 08:40
  • In your example query you are not querying for predicates, you are querying for subjects and objects of a triple pattern with a given predicate. And example for querying for predicate are exploratory queries, when you don't know anything. Then you first ask to see what are the predicates and classes of the data accessible through that endpoint. – Ivo Velitchkov Jun 20 '18 at 09:21
  • Exactly, i'm querying for subjects and objects of a triple pattern with a given predicate, and i'm looking for examples in real world to show we really need this query pattern. – Artemis1216 Jun 20 '18 at 15:32

1 Answers1

0

When a database provides a certain set of constructs, in general it should provide for querying all of those constructs. In the case of an RDF database, that's subject/object/predicate. In the case of neo4j that's labels, properties, and relationships.

One doesn't need a use case to demonstrate usefulness of querying the facets of a database. If one couldn't query those facets, you should instead question the usefulness of the database feature itself. (Why put something into a data model that isn't queryable?)

From the use case perspective though, any example someone generates for you will have to be bound to a particular domain and a particular data model. At the same time, you could have chosen many different data models for the same data. This is why some of those posting comments under your question are wondering why a use case is needed here.

Finally -- your example is tied to RDF. Asking about why a person would want to query a predicate is a bit curious, because the predicate of one triple (say, a URI) can be the subject of another. So things don't typically play just one role with respect to a triple, they may play others as well.

FrobberOfBits
  • 17,634
  • 4
  • 52
  • 86
  • Thanks for the answer, i understand all the usefulness and necessity. This question is to find real use example to persuade other people in management level. – Artemis1216 Jun 25 '18 at 14:09