RE: [web-annotation] Should we systematically use typing in the model (and in the examples)?

I think you would still have to infer many if not most types.  

But regardless, in the following shortened example, you might be able to infer some types (or fix them in context document), but I would worry about ambiguities and about implementers who want to use for additional purposes certain predicates that we rely on :

{
  "motivation": "bookmarking",
  "body": [ "Come back and view this image on a larger screen.",
     { "related": "http://dbpedia.org/page/Arc_de_Triomphe" },
     {  "source": "https://www.youtube.com/watch?v=BZLZyX3JdEM",
        "selector": { 
          "conformsTo": "http://www.w3.org/TR/media-frags/",
          "value": "t=247,280"  } 
     }
   ],
  "target": "http://tinyurl.com/ParisLandmark-jpg"
}

So if I assume as context the current version of http://www.w3.org/ns/anno.jsonld,  I can infer:
1.   the Domain of oa:motivatedBy, oa:hasBody, and oa:hasTarget is Annotation, so the graph is of type oa:Annotation -- probably safe;
2.   the Domain of both oa:hasSource and oa:hasSelector is oa:SpecificResource, so I have an oa:SpecificResource -- probably safe;
3.   the only Domain that dcterms:conformsTo and rdf:value share in the OA data model is oa:FragmentSelector, so maybe I have an oa:FragmentSelector -- but potentially unsafe to assume for sure (IMO);
4.   among oa Classes, the only one that can be the domain of skos:related is oa:SemanticTag, so maybe I have an oa:SemanticTag -- but potentially unsafe.

Making these inferences and expanding, I end up with: 
{
  "@context": "http://www.w3.org/ns/anno.jsonld",
   "@type": "Annotation",
  "motivation": "bookmarking",
  "body": [ "Come back and view this image on a larger screen.",
     {  "@type": "SemanticTag",
        "related": "http://dbpedia.org/page/Arc_de_Triomphe"
     },
     {  "@type": "SpecificResource",
        "source": "https://www.youtube.com/watch?v=BZLZyX3JdEM",
        "selector": { 
      "@type": "FragmentSelector",
      "conformsTo": "http://www.w3.org/TR/media-frags/",
      "value": "t=247,280" 
        } 
     }
   ],
  "target": "http://tinyurl.com/ParisLandmark-jpg"
}

I saved 4 @type triples. And maybe a couple of these could be fixed in the context document such that there's no reasoning to do. 

But what if the implementer wants to use skos:related or dccterms:conformsTo somewhere else in the graph? We provide nicknames for these in the context document, but they are not in our namespace and their scope is much broader than Web Annotation. Seems a mistake might be easy to make. May not be safe to assume FragmentSelector. Same issues for skos:related and inferring SemanticTag type.

Worse yet, what if a community comes up with a new kind of Selector class that also relies on dcterms:conformsTo and rdf:value. Seems a likely scenario and if so, then my inferencing (or context document) will be wrong (or in conflict).  Worse still, what if the 2.0 Web Annotation Data Model adds a new kind of Selector that uses both dcterms:conformsTo and rdf:value? Or a new kind of Target that uses skos:related?  Now I have a versioning dependency that I would rather not have to deal with. So maybe I only really saved 2 @type triples. 

I agree with the desire to minimize clutter in the JSON, but it's a slippery slope. We will have to be very careful about which types we leave to inferencing or the context document. And the developers I've talked to here generally favor erring on the side of too many @type triples.  They are not really expensive to process and they can save steps, whereas inferencing gets expensive quickly.

For what it's worth,

Tim Cole 

-----Original Message-----
From: Randall Leeds via GitHub [mailto:sysbot+gh@w3.org] 
Sent: Friday, August 07, 2015 11:06 AM
To: public-annotation@w3.org
Subject: Re: [web-annotation] Should we systematically use typing in the model (and in the examples)?

We could also maybe have the examples all assume to use a context we define once and use [typed
values](http://www.w3.org/TR/json-ld/#typed-values) to make a lot of the typing information in the examples unnecessary?

--
GitHub Notif of comment by tilgovi
See
https://github.com/w3c/web-annotation/issues/61#issuecomment-128748195

Received on Friday, 7 August 2015 22:31:59 UTC