Skip to content
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

[Don't merge] Microdata Test #1068

Closed
wants to merge 2 commits into from
Closed

Conversation

zuphilip
Copy link
Contributor

The website of the French newspaper Le Figaro uses schema.org as Microdata. While working for a translator for that newspaper I tried to traverse the Microdata and use it. The Microdata on that page does not follow the standards and therefore I ended up to scrape the data with some manually adjusted XPath, see #1067.

However, the Microdata translator here works and maybe a start for some general approach. I added some statements which will output the used types and properties. This can help to see quickly how the Microdata on a page looks like. My impression is that for our purposes only some small subset of the Microdata might be useful at all.

The issue for a microdata translator is here #366.

var usedTypes = [];
for (var i=0; i<schemaItems.length; i++) {
schemaItems[i].itemid = schemaItems[i].getAttribute("itemid") ||
(schemaItems[i].getAttribute("id") ? url+"#"+schemaItems[i].getAttribute("id") : url+"#itemid="+i);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just to have some (meaningful) itemid also when the attribute is missing. I thought that the fragment identifier might be a good idea to have something which is unique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant