W3C home > Mailing lists > Public > public-htmlvoc@w3.org > September 2022

Re: Slides

From: Kurt Cagle <kurt.cagle@gmail.com>
Date: Wed, 21 Sep 2022 09:42:18 -0700
Message-ID: <CALm0LSG+sJjO7nKkPmJxuUonoYjLtBgchGQg_P1cXSD8ZJ=iCg@mail.gmail.com>
To: Charles Munat <charles.munat@gmail.com>
Cc: public-htmlvoc@w3.org
I had a few thoughts after your presentation, Flores (and again, very cool
work here!):

If you're not doing this already, set your SHACL nodeKind to sh:BlankOrIRI.
Once you do this, you can basically stagger your HTML declarations as a
tree:

[a html:HTML;
     html:contains (
             [a html:HEAD;
              html:contains (
                   [a html:LINK;
                    html:attribute ([
                          a html:href;
                          attribute:value "http://mylink.com/resources.css
"^^xs:anyURI;
                          ]
                    html:attribute [
                          a html:rel;
                          attribute:value "stylesheet"^^xs:string
                          ])
                   ]
                   [a html:TITLE;
                    html:text "This is the title"^^xs:string;
                   ])
           ]
             [a html:BODY;
              html:contains (
                   [a html:H1;
                    html:id myDoc:_DocId1;
                    html:text "This is the title"^^xs:string;
                   ])
             ])
].

I normally prefer bottom-up ontologies, but this approach has a few key
benefits:

1. It echoes the tree-like structure of an HTML document. I think that's
going to end up being a big selling point to a lot of people.
2. SPARQL ordinarily does not make a distinction about order with
transitive closure, but most implementations do, in general, respect RDF
Lists.
3. I suspect strongly that when SPARQL 2.0 does finally emerge, RDF Lists
will end up becoming defined entities in their own rights (even Jena has an
RDF List object).
4. In the above example, you don't need to explicitly declare an instance
name for a given node. However, you can do so indirectly with an html:id
predicate (see the <H1> node above as an example).
5. The queries are a bit more complex, but they preserve sequences:

select ?elementType where {
     $this a html:HEAD.
     $this html:contains ?list.
     ?list rdf:rest*/rdf:first ?childElement.
     ?childElement a ?elementType.
     ?elementType rdfs:subClassOf* html:Element.
}

Result:
?elementType
html:LINK
html:TITLE

You could also make this fully recursive, probably with some variation of
rdf:rest*/rdf:first*/html:contains*.

6, Using a default namespace makes the structure even more clear:

PREFIX html: <http:///www.something/com/html#>
PREFIX attribute: <http:///www.something/com/attribute#>
PREFIX html <http:///www.something/com/html#>

[a :HTML;
    :contains (
             [a :HEAD;
              :contains (
                   [a :LINK;
                    :attribute ([
                          a :href;
                          attribute:value "http://mylink.com/resources.css
"^^xs:anyURI;
                          ]
                    :attribute [
                          a :rel;
                          attribute:value "stylesheet"^^xs:string
                          ])
                   ]
                   [a :TITLE;
                    :text "This is the title"^^xs:string;
                   ])
           ]
             [a :BODY;
              :contains (
                   [a :H1;
                    :id myDoc:_DocId1;
                    :text "This is the title"^^xs:string;
                   ])
             ])
].

On Tue, Sep 20, 2022 at 3:03 PM Charles Munat <charles.munat@gmail.com>
wrote:

> Flores,
>
> Just a reminder to please post a link to the slides from today’s meeting.
> I’m eager to dig in further.
>
> Thanks!
>
> Chas.
>
>
> Charles F. Munat
> Munat, Ltd.
> Wellington, New Zealand
>
Received on Wednesday, 21 September 2022 16:42:43 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 21 September 2022 16:42:44 UTC