W3C home > Mailing lists > Public > public-rdf-dawg-comments@w3.org > June 2004

"How Many ..."

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Mon, 14 Jun 2004 23:13:48 +0200
To: public-rdf-dawg-comments@w3.org
Message-ID: <40d6ef12.15977985@smtp.bjoern.hoehrmann.de>

Dear RDF Data Access Working Group,

  Regarding <http://www.w3.org/TR/rdf-dawg-uc/>, I would like to suggest
a requirement that a query language provides a simple means to access
answers to "how many" questions. It is common for user interfaces to
provide such information as summary along with the information or as a
preview for the actual data.

More specifically, I would like to select the number of statements which
match certain criteria. A simple example would be a FOAF document

  [ a foaf:Person;

      foaf:name "...";
      foaf:mbox_sha1sum "...";
      foaf:made <http://example.org/a>;
      foaf:made <http://example.org/b>;
      foaf:made <http://example.org/c>;
      foaf:made <http://example.org/d>;

  ] .

And I would like to ask

  how many things are known to be foaf:made by a foaf:Person
  that has a foaf:name "..." and a foaf:mbox_sha1sum "..."

Which would result in "4" (assuming that the cited document is all
information there is). It might be possible to achieve this through
application logic, i.e., the query langauge probably offers means to
ask for the same thing without the "how many" and the implementation
might return triples in response and I could than find out how many
triples it returned, but that would not scale very well if there are
millions of items.

Another - more complicated - example would be the EARL output of the
W3C MarkUp Validator, e.g.


I would like to know how many errors were found in order to create a
XHTML document like


This is straight-forward to do using XQuery, assuming that all W3C
members have a homepage and that there are no network errors, the
following would produce a document similar to the one above,

  declare namespace h = "http://www.w3.org/1999/xhtml";

  declare function local:errors($uri as xs:string) as xs:integer
    let $val := fn:concat("http://validator.w3.org/check?uri=",
                          fn:escape-uri($uri, fn:true()),
    return fn:count(fn:doc($val)/result/messages/msg)
    let $list := "http://www.w3.org/Consortium/Member/List"
    for $member in fn:doc($list)/h:html/h:body/h:ul/h:li

I would generally like to do the same thing with similar complexity
using RDF data sources, but I am not sure how much of this is in scope
of the the Data Access WG...

Received on Monday, 14 June 2004 17:14:30 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:52:05 UTC