#social 2015-08-13

2015-08-13 UTC
jasnell, KevinMarks, tantek, bblfish, shepazu_, the_frey, jaywink, pfefferle and the_frey_ joined the channel
#
cwebber2
arg, I'm really not sure how to structure something that's multiple @types in my activitystuff library
#
ben_thatmustbeme
if thats confusing to you, i'd say it would be confusing to others, might want to open an issue on that
#
cwebber2
ben_thatmustbeme: yes, may be a good idea
#
cwebber2
I'd certainly be interested in understanding what the required use case was
#
rhiaro
Things can have multiple types with AS2, right?
bblfish and the_frey joined the channel
#
cwebber2
rhiaro: right
#
cwebber2
rhiaro: there's an example here:
#
rhiaro
oh yeah
#
cwebber2
"@type": ["Place", "gr:Location"],
#
cwebber2
my activitystuff library (really need a better name eventually) expects just one type
#
cwebber2
honestly I wonder if there's a time where you need more than one type where multiple inheritance doesn't make more sense than multiple classes :P
the_frey and jaywink joined the channel
#
cwebber2
ben_thatmustbeme: do I raise that on the github issues or on the w3c one?
#
cwebber2
I never know anymore
jasnell_ and jasnell joined the channel
#
rhiaro
cwebber2: what are you actually not sure about? I thought ben suggested raising an issue because it was a problem with AS2, but it seems fine in AS2. Maybe I'm misunderstanding
#
cwebber2
rhiaro: well "I never know anymore" was about where to file the issue
#
cwebber2
but as for what I"m unsure about
#
cwebber2
it's about whether anyone is making use of multiple types on a single activitystreams object
#
cwebber2
rhiaro: it's certainly harder to model
#
cwebber2
rhiaro: eg, pypump has different subclasses for different object types
#
cwebber2
if an object can have multiple types, which class should it choose?
#
rhiaro
I guess it depends what the differences between the classes are
#
rhiaro
I think aaronpk might have something to say about post types and code hierarchy
jasnell and jasnell_ joined the channel
#
cwebber2
rhiaro: aaronpk: I'd be interested to hear thoughts on that :)
jasnell joined the channel
#
cwebber2
hi jasnell !
KevinMarks and jasnell joined the channel
#
jasnell
sorry cwebber2
#
jasnell
connectivity issues
#
jasnell
what's up
#
cwebber2
jasnell: was wondering if I could get your feedback on part of the AS spec
#
cwebber2
jasnell: I'm doing more implementation stuff, and I came to realize I have no idea how I would do this part in my library...
#
jasnell
the multiple types thing?
#
jasnell
saw that right before I lost connection
#
cwebber2
jasnell: yeah :)
#
cwebber2
I assume there's a historical reason!
#
jasnell
ok, so yeah, that's primarily an artifact of the extensibility model and JSON-LD
#
cwebber2
jasnell: do you know of any AS using applications that have made use of it?
#
cwebber2
full ack that it's possible in json-ld to do it, but whether we highlight it in the spec or not may matter
#
jasnell
nothing in production, but I have made use of it. My node.js impl supports it
#
cwebber2
jasnell: I suppose I should look at how you modeled things there :)
#
cwebber2
jasnell: (I think it wouldn't be possible in pypump to make use of this... I could in my scheme application, but it does feel like it would increase complexity, and I'm not sure it would be for any value at present)
#
jasnell
well, there are a couple of issues
#
jasnell
consider I have an extension like xyz:Person
#
jasnell
if all I have is @type: "xyz:Person", how do I know that it's something that extends as:Person?
#
cwebber2
jasnell: hm, I don't remember if json-ld has an inheritence model here, looking
#
jasnell
JSON-LD doesn't, but the vocabulary models do
#
jasnell
rdfs:subClassOf
#
cwebber2
I hardcoded the activitystreams inheritence model into activitystuff :)
#
jasnell
understood. So what if I create an extension to as:Place, for instance?
#
jasnell
xyz:MyPlace rdfs:subClassOf as:Place
#
jasnell
{"@type": "xyz:MyPlace", "longitude": 1, "latitude": 1, "category": "foobar"}
#
jasnell
how is a consuming application supposed to know that xyz:MyPlace is an extension of as:Place?
#
jasnell
allowing for multiple types allows the publishing application to do...
#
cwebber2
jasnell: but the application doesn't really know that it's an extension of that either right?
#
jasnell
right, it can't *really* know
#
cwebber2
it might not know it "inherits" from it, it might think they're totally different things
#
jasnell
unless you do something like...
#
jasnell
{"@type": ["as:Place", "xyz:MyPlace"], "longitude": 1, "latitude": 1, "category": "foobar" }
#
jasnell
which is really saying, you can treat this object as either a as:Place or xsd:MyPlace, and it just works
#
jasnell
you don't have to know *anything* about the relationship of as:Place or xyz:MyPlace in order to do something intelligent with it
#
cwebber2
so by treating it as OR you can "fake" inheritance
#
cwebber2
since there is no inheritance tree?
#
jasnell
yes. if you're doing processing at an RDF level, there is an inheritance tree that you can tap into, which allows you to ignore the multiple types, but if you're not processing at that level, this allows you to fake it
#
cwebber2
it feels kind of like a hacky way to do inheritance though...
#
jasnell
well, it's like creating a union type
#
jasnell
this thing is both of these other things
#
jasnell
in the node implementation, I have a rudimentary rdf reasoner implemented
#
jasnell
it's configured to know about certain rdfs:subClassOf type relationships between the various objects
#
cwebber2
okay, this is helpful to know jasnell
#
jasnell
if the reasoner knows that xyz:MyPlace is a subclassof as:Place, then it will only output @type:xyz:MyPlace
#
jasnell
sigh... @type=xyz:MyPlace
#
cwebber2
I do think this maybe makes things complex for applications like pypump which use an inheritance tree via python's classes
#
jasnell
yes, it makes things difficult to js implementations too, which do not have a multiple inheritance model
#
jasnell
which is why I use the reasoner ;-)
#
jasnell
the drawback is that without it, interoperable extensibility becomes more difficult
#
cwebber2
okay! thanks jasnell :)
b_, jasnell, the_frey and tantek joined the channel