Importing Schema Vocabulary?

I’m on an install of Omeka S for a project. I have been trying to import a new vocabulary with Schema, but it is not working. When uploaded, the vocab shows as 0 classes and 0 properties.

I have attempted to grab the RDF from each of these links, but I still have had no luck getting the vocab to stick–

http://schema.org/docs/developers.html#defs

http://schema.org/docs/schema_org_rdfa.html

Any ideas?

What settings are you using for the import? Getting the namespace URL stuff wrong in those settings is a common and easy way to get zero properties out of an import.

I guess that’s part of the problem. Since the RDF is somewhat complicated to get into, I’m not exactly sure which URL namespace to link to. I’ve tried putting all of these links that I posted into that spot, which may hinder the import. Schema is not my favorite at this moment since they make it a lot more difficult to import their vocabulary.

The namespace URL for a schema isn’t usually the same as any of the URLs where the file is located.

In the case of schema.org, I believe the proper URL is just “http://schema.org/

1 Like

I wouldn’t be surprised if others are running into this problem when trying to import new vocabularies and perhaps an actual working example (values) could be included in the documentation (or here)?

As a test (after several failed attempts so far trying to import VRA Core) I managed to import DC from an old .rdf file I had on my system from an unrelated project. The Vocabulary UI reports I have no classes but 15 properties. Not sure if that’s correct but partial success. perhaps, even though I’m looking to import other vocabularies (AAT, VRA, etc).

Thanks.

Carl

I Carl,
I had no problem importing schema.org vocabulary.
You can take every information you need here: http://lov.okfn.org/dataset/lov/vocabs/schema (you can also use http://lov.okfn.org/dataset/lov/ to retrieve info for the most important ontologies).
You need to set schema as prefix and my suggestion is to use n3 format of this vocabulary that you can download from http://www.w3.org/2012/pyRdfa/extract?uri=http%3A%2F%2Fschema.org%2Fdocs%2Fschema_org_rdfa.html&format=n3 as in isDefinedBy property that you can see in the LOV page.
Please consider that schema.org is really big, so Omeka needs time to load it into vacabularies’ table. In my experience I have found that the load page expires before you can see the vocabulary loaded message. Don’t worry, after a while, re-opening vocabularies config page you should see that schema has been loaded as expected.
The only serious problem I experienced (that’s why I’ve decided not to use schema.org) is that Omeka slow down when many vocabularies are load, especially as big as schema is.

This should be the config page:

Thanks, I’ll give that a try.

I appreciate your help!

Carl

1 Like

For big vocabulary, you can edit the n3 file, it’s very easy: just keep the properties you really need. It will be easier for authors to use them. Anyway, the Omeka team works on the big vocab issue.

2 Likes

Thanks Everyone.

I’m running Release Candidate 1.

Following Felice’s advice to try http://lov.okfn.org/dataset/lov/vocabs I was able to import schema.org in .n3 format and it loaded very quickly. I didn’t think to try editing the n3 files but will look into that. When I was testing a couple of other vocabularies (e.g. CreativeWork, Getty Vocabulary Program) the .n3 files would timeout during the import and fail.

However, I was able to import these vocabularies after I opened the .n3 files in the Protege ontology editor and saved as RDF/XML.

Just starting to dip my toe into understanding how to work with Vocabularies, RDF, etc., and easy to miss some of the more obvious points.

Thanks, again, for your help.

Carl

1 Like

Hey @carlj and any others adding vocabularies to Omeka S:

has anyone successfully imported VRA Core, and if so, where have you found a proper RDF file for it, and what settings are you using?

Thanks!

I would second @carlj with regards to timeouts, but for myself, it was with turtle files. 1-10 properties would import fine, quickly, but the parsing time would balloon dramatically with more, resulting in timeouts.

Converting the turtle file to RDF, imported nearly instantly.

-Graham

To fix the rdf issue, there is a patch on Omeka S (an update of an old dependency): https://github.com/omeka/omeka-s/pull/1335. With it, you can import very big ontologies in a few seconds.

Awesome! Good to know, thanks.

I second arkirkland’s call for an example of importing the VRA Core!

Mark

After some searching I found that the VRA Ontology is embedded as RDFa directly in the specification’s markup. Using W3C’s RDFa 1.1 Distiller I converted the RDFa to Turtle, which Omeka will import.

Distill it yourself using:

URI: http://purl.org/vra/
Output Format: Turtle
[the rest default]

Save the result and import the file into Omeka S using:

Vocbulary file: [select your file]
File format: Turtle
Prefix: vra
Namespace URI: http://purl.org/vra/
Label: VRA Ontology

After import I see 23 classes and 140 properties. I make no guarantees about the completeness or accuracy of the vocabulary, but it’s the closest thing to an importable RDF serialization of VRA I can find.

Thanks!

I have tried this, and it results in a blank screen. Maybe I need to Up some timeout settings somewhere?

Mark

A white screen is an error. Turn on error reporting, reproduce the error, and see if it records an error.

Thanks again. Sure enough, there is a 30 timeout kicking in. I’ve Upped this in php,ini, and still no joy. Searching…

I have now Upped the PHP timeout to a full ten minutes (600) seconds, and this import is still timing out!:

Fatal error : Maximum execution time of 600 seconds exceeded in /var/www/html/omeka-s/vendor/symfony/polyfill-mbstring/Mbstring.php on line 568

Should it be taking longer than this?

For big vocabulary, I use the development version of easyrdf, and I don’t have any issue any more with import. See https://github.com/omeka/omeka-s/pull/1335