Skip to content

Instantly share code, notes, and snippets.

What would you like to do? has "Each Working Group MUST publish a new draft of at least one of its active technical reports on the W3C technical reports index at least once every three months." The attached query is an attempt to encode to express this in SPARQL. Originally…
# For the groups that currently have an active technical report,
# return the date on which the group published their last report
# arq --data=
# --data=
# --query=
# This is not exactly right, it should return the maximum of the
# dates on which the group published the latest update to any of
# the their technical reports that were active three months ago.
# As a consequence, this will report the wrong date e.g. if the
# group had reports a,b active three months ago, and published
# no updates to them, but published a new report c; in this case
# the date of c will be reported, not max(a,b). Actually, I am
# not sure what the Process document requires here, and if a new
# technical report does not meet the updating requirement, how
# to encode that in the query. (I'd have thought it's possible,
# but any attempts of doing that result in ARQ returning garbage)
# Likewise, if a group had a,b,c active three months ago, and
# published all three of them as RECs, the result would not en-
# code that in the result as the group does not have active
# technical reports at the moment the query is run.
# ARQ-cvs currently does not support fn:current-date() and other
# functions that would be needed to encode the "three months",
# so the query just gives all active groups and dates.
PREFIX k: <>
PREFIX dc: <>
PREFIX org: <>
PREFIX mat: <>
PREFIX doc: <>
PREFIX rec: <>
PREFIX rdf: <>
PREFIX con: <>
PREFIX xsd: <>
PREFIX foa: <>
{ $document a rec:WD } UNION
{ $document a rec:CR } UNION
{ $document a rec:PR } UNION
{ $document a rec:PER } UNION
{ $document a rec:REC } UNION
{ $document a rec:NOTE } UNION
{ $document a rec:LastCall }
$document org:deliveredBy $x.
$x con:homePage $wg.
$document dc:date $date.
{ $document2 a rec:WD } UNION
{ $document2 a rec:CR } UNION
{ $document2 a rec:PR } UNION
{ $document2 a rec:PER } UNION
# A PR might have become a REC, or a draft
# might have become a Working Group Note
{ $document2 a rec:REC } UNION
{ $document2 a rec:NOTE } UNION
{ $document2 a rec:LastCall }
$document2 dc:date $date2.
$document2 org:deliveredBy $x2.
$x2 con:homePage $wg.
FILTER(xsd:date($date) < xsd:date($date2))
$foo con:homePage $wg.
$foo org:name $name.
$foo k:startingDate $sDate.
# ignore expired groups; this only works because the
# data does not include startingDates for groups that
# do not currently exist; endingDate cannot be used
# as there are active expired groups...
ORDER BY xsd:date($date) $wg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.