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

Add schema.org markup #25

Open
acka47 opened this Issue Jan 20, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@acka47
Contributor

acka47 commented Jan 20, 2017

We have a milestone for this in the AEP for some years now. We already did a first implementation of this in NWBib based on API 1.0, see hbz/nwbib#99. By now, we should be able to significantly improve the schema.org markup. The question is how to we will proceed doing the mapping. I suggest trying out the approach from last time. If it doesn't work well (i.e. if we can't map all the data we want to schema.org) we might think about using SPARQL for representing a resouce description with schema.org.

@acka47

This comment has been minimized.

Show comment
Hide comment
@acka47

acka47 Jan 20, 2017

Contributor

Let's start with an example, like http://lobid.org/resources/HT015436412. You currently get the following JSON-LD:

{
   "@context":"http://lobid.org/download/context.json",
   "alternativeTitle":[
      "Colourful Eifel"
   ],
   "collectedBy":[
      {
         "id":"http://lobid.org/resources/NWBib",
         "label":"Nordrhein-Westfälische Bibliographie"
      }
   ],
   "contribution":[
      {
         "agent":{
            "altLabel":"Citen, Chorst",
            "id":"http://d-nb.info/gnd/111495156",
            "label":"Ziethen, Horst",
            "type":[
               "Person"
            ]
         },
         "role":[
            {
               "id":"http://id.loc.gov/vocabulary/relators/edt",
               "label":"Herausgeber/in"
            }
         ],
         "type":[
            "Contribution"
         ]
      },
      {
         "agent":{
            "id":"http://d-nb.info/gnd/123024609",
            "label":"Ziethen, Anette",
            "type":[
               "Person"
            ]
         },
         "role":[
            {
               "id":"http://id.loc.gov/vocabulary/relators/ctb",
               "label":"Mitwirkende"
            }
         ],
         "type":[
            "Contribution"
         ]
      }
   ],
   "contributorOrder":[
      "http://d-nb.info/gnd/111495156 | http://d-nb.info/gnd/123024609"
   ],
   "describedby":{
      "dateCreated":"20080215",
      "dateModified":"20150828",
      "id":"http://lobid.org/resources/HT015436412",
      "label":"lobid Ressource"
   },
   "exemplar":[
      {
         "id":"http://lobid.org/items/HT015436412:DE-121:08%20Aq%2023#!",
         "label":"lobid Bestandsressource"
      }
   ],
   "extent":"108 S.",
   "hbzId":"HT015436412",
   "id":"http://lobid.org/resources/HT015436412#!",
   "isPrimaryTopicOf":{
      "id":"http://193.30.112.134/F/?func=find-c&ccl_term=IDN%3DHT015436412",
      "label":"hbz Verbundkatalog"
   },
   "isbn":[
      "9783929932744",
      "9783934328181"
   ],
   "language":[
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/deu",
         "label":"Deutsch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/eng",
         "label":"Englisch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/fra",
         "label":"Französisch"
      }
   ],
   "medium":[
      {
         "id":"http://rdvocab.info/termList/RDAproductionMethod/#1010",
         "label":"Print"
      }
   ],
   "note":[
      "Text dt., engl., franz."
   ],
   "nwbibspatial":[
      {
         "id":"http://purl.org/lobid/nwbib-spatial#n28",
         "label":"Eifel"
      }
   ],
   "nwbibsubject":[
      {
         "id":"http://purl.org/lobid/nwbib#s102000",
         "label":"Landesbeschreibungen"
      }
   ],
   "otherTitleInformation":[
      "in 9 Kapiteln der Eifel-Regionen"
   ],
   "publication":[
      {
         "location":"Köln",
         "publishedBy":"Ziethen-Panorama-Verl.",
         "startDate":"2007",
         "type":[
            "Publication"
         ]
      }
   ],
   "sameAs":[
      {
         "id":"http://hub.culturegraph.org/resource/HBZ-HT015436412",
         "label":"Culturegraph Ressource"
      }
   ],
   "statementOfResponsibility":"[Red. und Gestaltung: Horst Ziethen. Bildtexte: Anette Ziethen mit Textbeitr. von Peter Kremer. Engl.-Übers.: Gwendolen Webster ; John Stevens. Franz.-Übers.: France Varry. Niederländ.-Übers.: Transmit Deutschland]",
   "subject":[
      {
         "id":"http://d-nb.info/gnd/4013749-1",
         "label":"Eifel",
         "type":[
            "PlaceOrGeographicName"
         ]
      },
      {
         "label":"Bildband",
         "type":[
            "SubjectHeading"
         ]
      },
      {
         "id":"http://dewey.info/class/914/",
         "label":"Geografie Europas und Reisen in Europa"
      }
   ],
   "subjectChain":[
      "Eifel | Bildband"
   ],
   "subjectOrder":[
      "http://d-nb.info/gnd/4013749-1, Bildband"
   ],
   "title":"Die Eifel im Farbbild",
   "type":[
      "BibliographicResource",
      "Book"
   ]
}

The schema.org markup I would like to get looks like this:

{
   "@context":"http://schema.org",
   "alternativeHeadline":[
      "Colourful Eifel"
   ],
   "isPartOf":[
      {
         "id":"http://lobid.org/resources/NWBib",
         "name":"Nordrhein-Westfälische Bibliographie"
      }
   ],
   "contributor":[
      {
         "contributor":{
            "alternateName":"Citen, Chorst",
            "id":"http://d-nb.info/gnd/111495156",
            "name":"Ziethen, Horst",
            "type":[
               "Person"
            ]
         },
         "type":[
            "http://id.loc.gov/vocabulary/relators/edt",
            "Role"
         ],
         "roleName":"Herausgeber/in"
      },
      {
         "contributor":{
            "id":"http://d-nb.info/gnd/123024609",
            "name":"Ziethen, Anette",
            "type":[
               "Person"
            ]
         },
         "type":[
            "http://id.loc.gov/vocabulary/relators/ctb",
            "Role"
         ],
         "roleName":"Mitwirkende"
      }
   ],
   "description":{
      "dateCreated":"20080215",
      "dateModified":"20150828",
      "id":"http://lobid.org/resources/HT015436412",
      "name":"lobid Ressource"
   },
   "offers":[
      {
         "id":"http://lobid.org/items/HT015436412:DE-121:08%20Aq%2023#!",
         "name":"lobid Bestandsressource"
      }
   ],
   "numberOfPages":"108 S.",
   "id":"http://lobid.org/resources/HT015436412#!",
   "url":"http://193.30.112.134/F/?func=find-c&ccl_term=IDN%3DHT015436412",
   "isbn":[
      "9783929932744",
      "9783934328181"
   ],
   "inLanguage":[
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/deu",
         "type":"Language",
         "name":"Deutsch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/eng",
         "type":"Language",
         "name":"Englisch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/fra",
         "type":"Language",
         "name":"Französisch"
      }
   ],
   "about":[
      {
         "id":"http://purl.org/lobid/nwbib-spatial#n28",
         "name":"Eifel"
      },
      {
         "id":"http://purl.org/lobid/nwbib#s102000",
         "name":"Landesbeschreibungen"
      },
      {
         "id":"http://d-nb.info/gnd/4013749-1",
         "name":"Eifel",
         "type":[
            "PlaceOrGeographicName"
         ]
      },
      {
         "name":"Bildband",
         "type":[
            "SubjectHeading"
         ]
      },
      {
         "id":"http://dewey.info/class/914/",
         "name":"Geografie Europas und Reisen in Europa"
      }
   ],
   "publication":[
      {
         "location":"Köln",
         "publishedBy":"Ziethen-Panorama-Verl.",
         "startDate":"2007",
         "type":[
            "Publication"
         ]
      }
   ],
   "sameAs":"http://hub.culturegraph.org/resource/HBZ-HT015436412",
   "name":"Die Eifel im Farbbild",
   "type":[
      "Book"
   ]
}
Contributor

acka47 commented Jan 20, 2017

Let's start with an example, like http://lobid.org/resources/HT015436412. You currently get the following JSON-LD:

{
   "@context":"http://lobid.org/download/context.json",
   "alternativeTitle":[
      "Colourful Eifel"
   ],
   "collectedBy":[
      {
         "id":"http://lobid.org/resources/NWBib",
         "label":"Nordrhein-Westfälische Bibliographie"
      }
   ],
   "contribution":[
      {
         "agent":{
            "altLabel":"Citen, Chorst",
            "id":"http://d-nb.info/gnd/111495156",
            "label":"Ziethen, Horst",
            "type":[
               "Person"
            ]
         },
         "role":[
            {
               "id":"http://id.loc.gov/vocabulary/relators/edt",
               "label":"Herausgeber/in"
            }
         ],
         "type":[
            "Contribution"
         ]
      },
      {
         "agent":{
            "id":"http://d-nb.info/gnd/123024609",
            "label":"Ziethen, Anette",
            "type":[
               "Person"
            ]
         },
         "role":[
            {
               "id":"http://id.loc.gov/vocabulary/relators/ctb",
               "label":"Mitwirkende"
            }
         ],
         "type":[
            "Contribution"
         ]
      }
   ],
   "contributorOrder":[
      "http://d-nb.info/gnd/111495156 | http://d-nb.info/gnd/123024609"
   ],
   "describedby":{
      "dateCreated":"20080215",
      "dateModified":"20150828",
      "id":"http://lobid.org/resources/HT015436412",
      "label":"lobid Ressource"
   },
   "exemplar":[
      {
         "id":"http://lobid.org/items/HT015436412:DE-121:08%20Aq%2023#!",
         "label":"lobid Bestandsressource"
      }
   ],
   "extent":"108 S.",
   "hbzId":"HT015436412",
   "id":"http://lobid.org/resources/HT015436412#!",
   "isPrimaryTopicOf":{
      "id":"http://193.30.112.134/F/?func=find-c&ccl_term=IDN%3DHT015436412",
      "label":"hbz Verbundkatalog"
   },
   "isbn":[
      "9783929932744",
      "9783934328181"
   ],
   "language":[
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/deu",
         "label":"Deutsch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/eng",
         "label":"Englisch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/fra",
         "label":"Französisch"
      }
   ],
   "medium":[
      {
         "id":"http://rdvocab.info/termList/RDAproductionMethod/#1010",
         "label":"Print"
      }
   ],
   "note":[
      "Text dt., engl., franz."
   ],
   "nwbibspatial":[
      {
         "id":"http://purl.org/lobid/nwbib-spatial#n28",
         "label":"Eifel"
      }
   ],
   "nwbibsubject":[
      {
         "id":"http://purl.org/lobid/nwbib#s102000",
         "label":"Landesbeschreibungen"
      }
   ],
   "otherTitleInformation":[
      "in 9 Kapiteln der Eifel-Regionen"
   ],
   "publication":[
      {
         "location":"Köln",
         "publishedBy":"Ziethen-Panorama-Verl.",
         "startDate":"2007",
         "type":[
            "Publication"
         ]
      }
   ],
   "sameAs":[
      {
         "id":"http://hub.culturegraph.org/resource/HBZ-HT015436412",
         "label":"Culturegraph Ressource"
      }
   ],
   "statementOfResponsibility":"[Red. und Gestaltung: Horst Ziethen. Bildtexte: Anette Ziethen mit Textbeitr. von Peter Kremer. Engl.-Übers.: Gwendolen Webster ; John Stevens. Franz.-Übers.: France Varry. Niederländ.-Übers.: Transmit Deutschland]",
   "subject":[
      {
         "id":"http://d-nb.info/gnd/4013749-1",
         "label":"Eifel",
         "type":[
            "PlaceOrGeographicName"
         ]
      },
      {
         "label":"Bildband",
         "type":[
            "SubjectHeading"
         ]
      },
      {
         "id":"http://dewey.info/class/914/",
         "label":"Geografie Europas und Reisen in Europa"
      }
   ],
   "subjectChain":[
      "Eifel | Bildband"
   ],
   "subjectOrder":[
      "http://d-nb.info/gnd/4013749-1, Bildband"
   ],
   "title":"Die Eifel im Farbbild",
   "type":[
      "BibliographicResource",
      "Book"
   ]
}

The schema.org markup I would like to get looks like this:

{
   "@context":"http://schema.org",
   "alternativeHeadline":[
      "Colourful Eifel"
   ],
   "isPartOf":[
      {
         "id":"http://lobid.org/resources/NWBib",
         "name":"Nordrhein-Westfälische Bibliographie"
      }
   ],
   "contributor":[
      {
         "contributor":{
            "alternateName":"Citen, Chorst",
            "id":"http://d-nb.info/gnd/111495156",
            "name":"Ziethen, Horst",
            "type":[
               "Person"
            ]
         },
         "type":[
            "http://id.loc.gov/vocabulary/relators/edt",
            "Role"
         ],
         "roleName":"Herausgeber/in"
      },
      {
         "contributor":{
            "id":"http://d-nb.info/gnd/123024609",
            "name":"Ziethen, Anette",
            "type":[
               "Person"
            ]
         },
         "type":[
            "http://id.loc.gov/vocabulary/relators/ctb",
            "Role"
         ],
         "roleName":"Mitwirkende"
      }
   ],
   "description":{
      "dateCreated":"20080215",
      "dateModified":"20150828",
      "id":"http://lobid.org/resources/HT015436412",
      "name":"lobid Ressource"
   },
   "offers":[
      {
         "id":"http://lobid.org/items/HT015436412:DE-121:08%20Aq%2023#!",
         "name":"lobid Bestandsressource"
      }
   ],
   "numberOfPages":"108 S.",
   "id":"http://lobid.org/resources/HT015436412#!",
   "url":"http://193.30.112.134/F/?func=find-c&ccl_term=IDN%3DHT015436412",
   "isbn":[
      "9783929932744",
      "9783934328181"
   ],
   "inLanguage":[
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/deu",
         "type":"Language",
         "name":"Deutsch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/eng",
         "type":"Language",
         "name":"Englisch"
      },
      {
         "id":"http://id.loc.gov/vocabulary/iso639-2/fra",
         "type":"Language",
         "name":"Französisch"
      }
   ],
   "about":[
      {
         "id":"http://purl.org/lobid/nwbib-spatial#n28",
         "name":"Eifel"
      },
      {
         "id":"http://purl.org/lobid/nwbib#s102000",
         "name":"Landesbeschreibungen"
      },
      {
         "id":"http://d-nb.info/gnd/4013749-1",
         "name":"Eifel",
         "type":[
            "PlaceOrGeographicName"
         ]
      },
      {
         "name":"Bildband",
         "type":[
            "SubjectHeading"
         ]
      },
      {
         "id":"http://dewey.info/class/914/",
         "name":"Geografie Europas und Reisen in Europa"
      }
   ],
   "publication":[
      {
         "location":"Köln",
         "publishedBy":"Ziethen-Panorama-Verl.",
         "startDate":"2007",
         "type":[
            "Publication"
         ]
      }
   ],
   "sameAs":"http://hub.culturegraph.org/resource/HBZ-HT015436412",
   "name":"Die Eifel im Farbbild",
   "type":[
      "Book"
   ]
}
@acka47

This comment has been minimized.

Show comment
Hide comment
@acka47

acka47 Jan 20, 2017

Contributor

For the start, we could leave out – the probably not so trivial – adition of nwbibsubject and nwbibspatial to the about array.

Contributor

acka47 commented Jan 20, 2017

For the start, we could leave out – the probably not so trivial – adition of nwbibsubject and nwbibspatial to the about array.

@ChristophEwertowski

This comment has been minimized.

Show comment
Hide comment
@ChristophEwertowski

ChristophEwertowski Jan 20, 2017

Looks quite fine to me. But why not go full schema.org and use schema.org/editor /contributor? I suppose not all roles of the LoC have an expression in schema.org but for those who have...

Also it would be more beautiful to use startDate only in combination with a endDate and otherwise use datePublished.

ChristophEwertowski commented Jan 20, 2017

Looks quite fine to me. But why not go full schema.org and use schema.org/editor /contributor? I suppose not all roles of the LoC have an expression in schema.org but for those who have...

Also it would be more beautiful to use startDate only in combination with a endDate and otherwise use datePublished.

@fsteeg fsteeg self-assigned this Jan 20, 2017

@fsteeg fsteeg added the ready label Jan 20, 2017

@acka47

This comment has been minimized.

Show comment
Hide comment
@acka47

acka47 Jan 20, 2017

Contributor

Looks quite fine to me. But why not go full schema.org and use schema.org/editor /contributor? I suppose not all roles of the LoC have an expression in schema.org but for those who have...

I think we should use a common approach for indicating contributors and roles in schema.org. When using the schema:Role approach we shouldn't also use the direct linking via a specific property like schema:editor etc.

Also it would be more beautiful to use startDate only in combination with a endDate and otherwise use datePublished.

The thing is that we put the publication information into a PublicationEvent object (at least it should be PublicationEvent instead of Publicationas the second doesn't exist in schema.org, see also #185). And datePublished isn't supposed to be used on an event but on a CreativeWork...

Contributor

acka47 commented Jan 20, 2017

Looks quite fine to me. But why not go full schema.org and use schema.org/editor /contributor? I suppose not all roles of the LoC have an expression in schema.org but for those who have...

I think we should use a common approach for indicating contributors and roles in schema.org. When using the schema:Role approach we shouldn't also use the direct linking via a specific property like schema:editor etc.

Also it would be more beautiful to use startDate only in combination with a endDate and otherwise use datePublished.

The thing is that we put the publication information into a PublicationEvent object (at least it should be PublicationEvent instead of Publicationas the second doesn't exist in schema.org, see also #185). And datePublished isn't supposed to be used on an event but on a CreativeWork...

@acka47

This comment has been minimized.

Show comment
Hide comment
@acka47

acka47 Mar 8, 2017

Contributor

What's the status of this? As far as I can see already is some schema.org JSON-LD embedded but it is still based on the mapping from API 1.0, see https://github.com/hbz/lobid-resources/blob/master/web/app/views/tags/schema_org.scala.html. I suggest to either fix this before the launch or – which is more realistic – to remove schema.org for now.

Contributor

acka47 commented Mar 8, 2017

What's the status of this? As far as I can see already is some schema.org JSON-LD embedded but it is still based on the mapping from API 1.0, see https://github.com/hbz/lobid-resources/blob/master/web/app/views/tags/schema_org.scala.html. I suggest to either fix this before the launch or – which is more realistic – to remove schema.org for now.

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