-
-
Save dginev/be5029e8c4ecf095b9abacd78d81aa9a to your computer and use it in GitHub Desktop.
Basic example of using HTML+RDFa for annotating MathML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body vocab="http://purl.org/dc/terms/"> | |
<math property="subject" content="linear-algebra" typeof=""> | |
<mi property="description" content="prime-number" typeof="">n</mi> | |
<mo property="description" content="scalar-multiplication"></mo> | |
<msup> | |
<mi property="description" content="matrix" typeof="">A</mi> | |
<mi property="description" content="transpose" typeof="">T</mi> | |
</msup> | |
</math> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"@id": "_:Nf768098632bd4b099f61b1f66cd8abbe", | |
"http://purl.org/dc/terms/description": [ | |
{ | |
"@value": "prime-number" | |
} | |
] | |
}, | |
{ | |
"@id": "_:N408a0e4f025045cc933c4a10f49e5de0", | |
"http://purl.org/dc/terms/description": [ | |
{ | |
"@value": "matrix" | |
} | |
] | |
}, | |
{ | |
"@id": "_:Ncdd1f89f11754343a3827bb4c7974faf", | |
"http://purl.org/dc/terms/description": [ | |
{ | |
"@value": "transpose" | |
} | |
] | |
}, | |
{ | |
"@id": "", | |
"http://www.w3.org/ns/rdfa#usesVocabulary": [ | |
{ | |
"@id": "http://purl.org/dc/terms/" | |
} | |
] | |
}, | |
{ | |
"@id": "_:N58dfa990909f4113ad6fe25f2a54f355", | |
"http://purl.org/dc/terms/description": [ | |
{ | |
"@value": "scalar-multiplication" | |
} | |
], | |
"http://purl.org/dc/terms/subject": [ | |
{ | |
"@value": "linear-algebra" | |
} | |
] | |
} | |
] |
The annotations can be doubtlessly improved in multiple ways - better vocabulary, better use of the vocabulary, better granularity, better interop with existing browser indexing solutions... The main question this Gist wants to pose is whether RDFa
is the right specification for this information to reside in.
Here are the current structured data policies of Google, which indicate focusing on using the schema.org vocabualry, and a preference to coarse-grained metadata via JSON-LD, rather than the fine-grained example I added here. Here is one example for a recipe webpage with structured annotations.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Rendered MathML+RDFa formula by Firefox:
Is this sufficient for baseline search-friendly markup? Are there additional markup needs on the MathML tree itself for search to be fully aided?