W3C home > Mailing lists > Public > semantic-web@w3.org > March 2018

Re: Is there a "has" predicate?

From: Dan Brickley <danbri@danbri.org>
Date: Fri, 9 Mar 2018 07:11:40 -0800
Message-ID: <CAFfrAFqmHAYNWW29ukEmDROhJ+hR_zQ2wG+ubGD9vTXY66+eQg@mail.gmail.com>
To: Hugh Glaser <hugh@glasers.org>
Cc: Melvin Carvalho <melvincarvalho@gmail.com>, Semantic Web <semantic-web@w3.org>
Also RDF history,

The original Model and Syntax spec had this "has a"-(property) language,

"""We can view a set of statements (members of *Statements*) as a directed
labeled graph: each resource and literal is a vertex; a triple {p, s, o} is
an arc from s to o, labeled by p. This is illustrated in figure 11.

[image: statement graph template]D

Figure 11: Simple statement graph template

This can be read either

*o is the value of p for s*

or (left to right)

*s has a property p with a value o*

or even

*the p of s is o """*

See https://www.w3.org/TR/1999/REC-rdf-syntax-19990222/


ps. Btw it seems W3C have broken the original RDF M+S and Schema spec
Working Drafts by adding Javascript that navigates browsers to the footer
of each doc, and in the case of M+S mistakenly redirects readers to RDFS
1.1 instead of concepts/syntax docs.

pps. I copied html including an image into this msg on my phone, I hope it
comes through in email ok

On 9 Mar 2018 04:23, "Hugh Glaser" <hugh@glasers.org> wrote:

I love this thread.

I think I could base an entire Semantic Web and Linked Data course on

> Is there a "has" predicate?

> e.g.
> Alice has 10^^<#apples>

And all the ramifications.
(Including edge issues such as what seems to me to be an uncomfortable
relationship of RDF and XML Schema datatypes that sort of sit outwith the
RDF model.)

Some more comments.

Now Melvin has told us something of how the RDF might be consumed, we can
begin to think properly of what would be best - as always, things can only
be usefully judged with respect to whether they are fit for any purpose
they might have.
We must remember that anything is fit for purpose in a write-only store!

Essentially, Melvin asked:

> Is there a "bar" predicate?
> e.g.
> foo bar 10^^<#baz>
And of course the bald answer is "no".
It is your concept of what "bar" means, and unless you personally have
already defined the same predicate, no-one else will have had the same
But if you tell me what you mean by "bar", I might be able to suggest a
predicate that someone else has used that has some similarity.
And of course you can define your own datatype, if that is useful (I think,
but I find https://www.w3.org/TR/swbp-xsch-datatypes/#sec-dl-dt rather hard
But actually, if you only use "has" as you describe fro apples/satoshis, I
guess the datatype gives no added value or discrimination.

What you are actually doing here, is using RDF triples as a triple/graph
store, without any semantics to speak of.
Hence many of us on the list will have gagged somewhat at the initial
"Hang on, I want some semantics here!"
But if that is all you want, then I say "Go for it!" - your "has" is fine.

And yes, you may want to choose a richer text string than "has" or "bar"
for your predicate, as comments and descriptions are always useful for
documentation and readability.

But if you want a bit (or a lot) more modelling, there have been various
useful suggestions already in the thread, of course.

With respect to your use case/application, I have a feeling you are going
to have to get quite a bit more complicated, if you are going to do
anything of interest with the blockchain.
If you are representing a wallet or whatever, then you will need to know
all sorts of stuff about the transactions that Alice has the keys for
concerning the aggregations and fractions of the satoshis.
And if you are allowing transactions, then you will need to be doing stuff
for "sweeping" and things as the transactions happen.
If you leave it as you have, then all you are really doing is representing
a ledger, without any significant distribution or whatever.

Since it is only polite, I'll also try to answer your questions, even
though there are people much better qualified :-) :

> On 8 Mar 2018, at 22:19, Melvin Carvalho <melvincarvalho@gmail.com> wrote:
> Thanks Dan.  Perhaps my use case may shed some more light.
> Distributed ledger technology is a hot topic right now, and I was
thinking that a "has" predicate could be used to create a distributed
> <Alice> has 10^^<#satoshis>
> <Bob> has 20^^<#satoshis>
> Indeed it would be possible to create a payment using a PATCH in this
way, creating a truly scalable distributed / decentralized ledger.
> Perhaps 'owns' is a better term here, tho im not sure
> Question 1 is:
> <Alice> has 10^^<#satoshis>
> the same as
> <Alice> <#satoshis> 10 # probably not as 10 would be xsd:int
And not even functionally the same in terms of usefulness.
The satoshi datatype is pretty worthless.
You can't query it like you can in the second version (hence my comment
right at the start on edge issues).
And a store won't help you do anything useful with it, I think.
The second version you can do
{?who <#satoshis> ?value .}
10 will not usually be xsd:int unless you say it is, by the way.

But note!!, don't forget:
Asserting (in either version) that Alice has 10 satoshis twice will simple
do that - her balance will not increase, whereas asserting she has 10, and
then asserting that she has 9 will result in her apparently having 19 (or
an ambiguity of her balance, however you want to interpret it.)
It depends what your use case and meaning are, but I think that says that
this is a Bad Way of doing things. :-)

> Question 2 is:
> <Alice> has 10^^<#satoshis>, 20^^<#satoshis>
> legal?
Yes (modulo any syntax problems).
It is a legal structure, but I think you mean is it legal in terms of
That is what I think I tried to discuss in the answer to Question 1.

> You want to avoid having multiple balances you see.  And if its possible
to avoid without SHACL / ShEx that would be a simplification.
You can ask yourself whether
> <Alice> has 10^^<#satoshis>, 10^^<#satoshis>
is "legal" too.

Now we know that what you are trying to represent is balance, not
transactions, we move into a new world.
Representing temporal aspects, such as changing real world values would be
a nice couple of lectures (or more!) in my course.
But it does strike me that the blockchain, which is designed to be
immutable, is a better representation suited for RDF than trying to keep a
store of changing balances that are snapshots of that blockchain.

I suspect you now have a feeling that there might be better ways to model
this for your use case.

So, many thanks for the question, and good luck finding a good solution to
the problem.


> On 8 Mar 2018 07:08, "Melvin Carvalho" <melvincarvalho@gmail.com> wrote:
> e.g.
> Alice has 10^^<#apples>

023 8061 5652
Received on Friday, 9 March 2018 15:12:08 UTC

This archive was generated by hypermail 2.3.1 : Friday, 9 March 2018 15:12:16 UTC