-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Badge extensions proposal (draft 0.2) #20
Comments
Since we were talking today about xAPI integration as a desired extension (or evidence form), maybe looking at the xAPI extensions spec would be useful? |
Quick pingback to #8 |
After offline discussion with @brianloveswords @kayaelle and @ottonomy, we're suggesting a change to the core proposal. Issue with the current proposalPutting extensions in a specific
If the extensions example above is put into the wild, a client library would need to understand the Revised Proposal (0.3)Extensions are top level members of the assertion. A new field, An example,
The example above adds an When the extension described in
|
This is good. I like how the reference to the openbadges spec is in here along with the extension spec. One question: should there be two extension references? One for age and one for location? |
@kayaelle - I think an extension spec can define multiple new members. Maybe age and location don't belong together...but...if they did, they could be in a single specification. |
I think we may want to be careful about combining specs. I think it can diminish the effectiveness of the idea of extensibility if they share specs. If specs get combined, there should probably be a reason for combining vs not combining. |
@kayaelle I think there should... It makes sense to me that top level elements should be individually validatable if they're not in the core assertion spec. |
@kayaelle I've been starting some work on a node module that will do verification of badge objects with top-level property extensions. It leads me to do a lot of thinking about what is the closest "go-with-the-flow" structure for schema verification, and I agree that one schema specification per additional property is best. I think from this revised draft, we'll probably need to modify the contents of badgeSpecifications to not be bare URLs, because I'd like to know as I'm beginning the verification process which property to test against which specification. One possibility would be to use a list of properties instead (object format):
Or an array of objects:
...and one element of the 0.2 proposal I would like specific comment on would be the 'schema-hash' component, which would be compatible with this second approach. The advantages from the perspective of the validation software package being:
Disadvantages being:
|
@cmcavoy: I've been thinking a bit on your comment from today's BA Standard Working Group call on whether or not to reference which property name is attached to a particular extension schema, and it could indeed be done either way. Some thoughts:
|
Ok, @cmcavoy your draft 0.3 is fine by me. 👍As you define it, additional properties may be added to a badge object:
and a schema array must be referenced:
The schema (in JSON-schema) for each badgeSpecification tells you which properties it covers, starting with the OBI schema, which defines all the the core properties, allowing additionalProperties. Every other badgeSpecification must allow additionalProperties as well (allowing the core properties without redefining them). Each schema is designed to tell consumers how to interpret the additional properties the issuer wants to use
This schema, hosted at the second badgeSpecification address listed in the issuer's badgeClass, only concerns itself with properties added to the badge, allowing any other properties of the badgeclass to be governed by other rules, in this case, the rules of the Open Badges Standard 1.5 badgeClass schema. I'm attached to the idea that we could get several advantages from issuers providing a hash of the schema for consumers' and the ecosystem's benefit, but I haven't managed to convince anybody. Sounds like the right situation for an extension, right? We could add a second property that could contain metadata on each of these specifications, including my hash function:
Each extension might define rules for multiple properties, and @cmcavoy's proposed technique doesn't help us recover from conflicts in how different extensions may define a particular property. Yeah, that's pretty esoteric and unlikely. Perhaps.. Maybe in the future, issuer.edu decides that they want to use an updated version of the extension that allows a second property, "presidentFullName":
This uses the same property name as before but would fail verification against the original schema which didn't allow additional properties inside "photographOfAPrintedCopyOfTheBadgeSignedByTheUniversityPresident". So they add an additional property "prezPhotoUpdate" to the badge that is a duplicate other than adding the new property. Perhaps "badgeSpecificationSecure" could allow issuers to declare exceptions to rules found in the schema:
And then as an extension author, my responsibility would be to give the issuers good enough benefits for using the extension that they'd give me the schema-hashes I would like to have as a developer of badge consumer applications. And I've got to build the consumer applications that would give them and other consumers to exploit the value of this possible extension. It's possible nobody will care about these features, and the OB ecosystem would still be better off for having added the extension features (and the additional flexibility of @cmcavoy's approach that my 0.2 proposal did not have.) Ok, @cmcavoy, I am on board with your style of doing it:
|
@ottonomy don't give up just yet. There's a lot of material in this thread, need to think it through a bit more. I'd really like to understand more about json-schema. A lot of this is riding on json-schema working well for us, but none of us have significant experience with it (that I know of). |
Andrew seems pretty familiar with json-schema. Could we bring him in to help thing through some things? |
Helpful Lint tool: http://jsonschemalint.com/ |
npm validator module https://www.npmjs.org/package/jsonschema |
I pinged @andrewhayward on IRC -- maybe we'll be lucky enough to get him to drop in. I've been playing around with JaySchema, which is schema draft 4 ready, but that was the only factor I looked at when I chose one to fiddle with. @kayaelle, thanks for the lint tool! |
That I'm aware of, there's no way to handle dynamic schema validation based on properties unknown in advance. It's not a problem in and of itself, but would require us to write our own custom solution for validation (which it seems @ottonomy has already started work on anyway), rather than just using any old JSON schema validator. The only solution I can see that would stay within the bounds of pure JSON schema validation would be to have entirely custom schemas that extend the core definition as provided by the OBA. {
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Badge Class Extension",
"type": "object",
"allOf": [
{"$ref": "http://openbadges.org/schema/v1.1/badge-class.json#"},
{
"properties": {
...
}
}
]
} Anyway, a suggestion, based on reading through the above (though one I have my reservations about):
The downside to this idea is that any existing JSON schema already written (such as Based on this final point, I would instead recommend not including the badge spec in the list, and rather introduce two new properties: I don't know if it makes more sense to just have a list of documents that extend the spec, or to explicitly itemise every new property, and a location at which it is defined ( Side note - I'd err on the side of putting something like a |
Moving to archive. |
Abstract
This proposal shows how additional metadata fields to add more information to a badge could be standardized in an open distributed fashion in keeping with the spirit of the Open Badges Infrastructure.
The Problem
The 1.0 Open Badges Specifcation allows issuers to include additional metadata fields in the badgeClass JSON, saying "additional properties are allowed if they don't clash with existing properties." Issuers are encouraged to namepace their additions to minimize the risk of two issuers defining differently implemented properties that have the same name.
This type of freedom makes it impossible to determine how to interpret the additional metadata, and there is no way to tell if two different badges use the same understanding of an additional property that they have included.
For example, two issuers include a property named "location" in their badge. One provides a URI of a website where someone can sign up for an online course that issues the badge. The other provides a US street address and geolocation of a school that at one time offered a course that issued the badge.
Discussion
Much of the usefulness of the additional properties, as currently allowed, is assumed to be internal to the issuer, because the implementation of those properties could be closed-source. But many badges might have use for providing more information in a common, machine-readable format.
The Proposal
Define an
extensions
array as a property of the badge class, issuer organization, and badge assertion JSON. This is an unordered list ofextensionObjects
, each of which follow a structure like the following example using JSON-schema (JSON-LD, a w3c-track similar structured data specification, is also under consideration):The proposal also requires an extension definition file to be accessible at the schema.reference URL (JSON-schema). In this case, it would define that the extension content could (or must) have a property called
extensionProperty
whose content would be text. The issuer generates a sha1 hash of the json retrieved from that location and includes it in the referrer object following the formatalg$hash
. This allows applications dealing in extended badges to cache them and determine if schema have changed, or if schema referenced at different locations are identical.Consequences
Backwards Compatibility: The proposal is backwards compatible with the 1.0 assertion specification for the badgeClass. It is ambiguous if it is compatible with the assertion or the issuer organization, though the addition does not conflict with any existing property. If an application analyzing the extended badge does not know how to understand the extensions array, it should ignore and leave them intact.
Standardized extension formats allow multiple issuers to define additional metadata in common, so that badge consumers can better understand...
1. What the additional information means to the issuer in terms of what fields are available and/or required as well as the data types that could populate those fields.
2. Whether two different badges are using the same definition for an additional property as each other.
3. Whether a badge extension is properly formed according to its definition.
Request for Comment and Code
The text was updated successfully, but these errors were encountered: