ruby-rdf / rdf-vocab

Common RDF Vocabularies
The Unlicense
50 stars 29 forks source link

Add EBUCore vocabulary #18

Closed mjgiarlo closed 9 years ago

acoburn commented 9 years ago

@mjgiarlo is there a special reason why the ebucore:hash property was renamed to ebucore:ebucore_hash?

mjgiarlo commented 9 years ago

@acoburn Ah! I forgot about that -- maybe you can help me get past it. vocab-fetch barfs, presumably because "hash" is a thing in Ruby:

$ vocab-fetch --uri http://www.ebu.ch/metadata/ontologies/ebucore/ebucore# --source https://www.ebu.ch/metadata/ontologies/ebucore/ebucore.rdf --class-name EBUCore
# -*- encoding: utf-8 -*-
# This file generated automatically using vocab-fetch from https://www.ebu.ch/metadata/ontologies/ebucore/ebucore.rdf
require 'rdf'
module RDF
  class EBUCore < RDF::StrictVocabulary("http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#")
/home/mjg/workspace/rdf/lib/rdf/vocabulary.rb:294:in `has_key?': no implicit conversion of RDF::Vocabulary::Term into Integer (TypeError)
        from /home/mjg/workspace/rdf/lib/rdf/vocabulary.rb:294:in `to_s'
        from /home/mjg/workspace/rdf/lib/rdf/vocabulary.rb:137:in `property'
        from /home/mjg/workspace/rdf/lib/rdf/vocabulary.rb:358:in `block in load'
        from /home/mjg/workspace/rdf/lib/rdf/vocabulary.rb:357:in `each'
        from /home/mjg/workspace/rdf/lib/rdf/vocabulary.rb:357:in `load'
        from /home/mjg/workspace/rdf/lib/rdf/cli/vocab-loader.rb:141:in `run'
        from /home/mjg/workspace/rdf/lib/rdf/cli/vocab-loader.rb:92:in `go'
        from workspace/rdf/script/vocab-fetch:7:in `<main>'

When I download and hand-edit the RDF s/hash/ebucore_hash, it no longer barfs. (But in so doing, I've broken the URI.) Is there a solution or workaround you know of? @acoburn

acoburn commented 9 years ago

@mjgiarlo did you also change the dc:alternative, dc:modified and dc:created to dcterms? (Those properties don't exist in dc11)

This is a problem with the ebucore vocabulary and I'd be more comfortable bringing this up with the publishers (and waiting for them to fix it). I'd be very hesitant to modify the content of an ontology just so it fits into a ruby expression of it.

mjgiarlo commented 9 years ago

@acoburn I just changed those too since they were causing tests to fail. I can ping the developers re: the three dc11 pointers and just use the working Ruby class in my own codebase for now.

The issue with "hash" is not a problem with the ontology, exactly, is it?

acoburn commented 9 years ago

@gkellogg would know why a property called hash causes errors

gkellogg commented 9 years ago

There are definitely times when errors in the base vocabulary need to be fixed s that consistence checks will pass. I don't think we can avoid this, but would be good to have an automated patch system so they don't need to be corrects manually. Definitely, the vocabulary maintainers should be encouraged to fix the original.

Regarding accessors, such as "hash", sometimes you can't use a Ruby method accessor, and need to use the index approach, such as EbuCore[:hash]. Not good to change core terms for convenience, although I could see a mechanism for providing aliases.

mjgiarlo commented 9 years ago

I've pinged the maintainers about the three dc/dc11 errors and the issue with "hash," in the meantime.

mjgiarlo commented 9 years ago

@gkellogg Assuming the ontology maintainers fix the DC-related errors and publish a new version, how do you recommend I proceed with the hash-related issue? It makes vocab-fetch very :angry:.

gkellogg commented 9 years ago

@mjgiarlo, the problem was that Vocabulary created a property method for hash, which interfered with internal behavior on Object#hash. I added hash to property in the list of accessor methods that aren't created. Note, you'll need to do the vocab["hash"] access method.

gkellogg commented 9 years ago

@mjgiarlo To complete this merge, you'll need to re-generate using the updated vocab-loader in the develop branch of RDF.rb.

mjgiarlo commented 9 years ago

OK, in the meantime, the EBUCore maintainer wrote to say he's corrected the three DC/DCT-related issues and he's renamed "hash" to "hashCode" in the ontology. I'll try regenerating this vocabulary and then I'll force-push to my branch. Thanks, @gkellogg

mjgiarlo commented 9 years ago

Done. @gkellogg @acoburn

artob commented 9 years ago

the EBUCore maintainer wrote to say he's corrected the three DC/DCT-related issues and he's renamed "hash" to "hashCode" in the ontology

Of course, java.lang.Object#hashCode() is a core method in Java, so that may yet come back to bite him on other fronts... :wink:

mjgiarlo commented 9 years ago

What's Java?

:japanese_goblin:

gkellogg commented 9 years ago

Looks like some new errors were introduced into the vocabulary, based on the Travis-CI failures.

mjgiarlo commented 9 years ago

Yes, indeed. Just wrote the EBUCore folks about those errors.

Four of them are related to typos which should be easily correctable. I'm not quite sure about the one related to "relation" in MA. I see references to "relation" in the MA documentation but I'm not seeing it defined in RDF::Vocab::MA.

I'll make sure to run the test suite before pushing again, like I should have been doing already. :)

mjgiarlo commented 9 years ago

@acoburn @gkellogg OK, Travis is :green_heart:. (May I also ask when a new version of RDF::Vocab might be released?)

And @bendiken, the ontology has renamed hashCode to hashValue so there's that. :wink:

gkellogg commented 9 years ago

It looks like the vocabulary file still needs to be generated.

gkellogg commented 9 years ago

@mjgiarlo Once the new vocabulary file is generated, and tests pass, I can pull the changes and push an update.

mjgiarlo commented 9 years ago

@gkellogg This? https://github.com/ruby-rdf/rdf-vocab/pull/18/files#diff-0a20044de61b1efb8ce5c8eb0c5b6cad Ths vocabulary file is there but GitHub isn't displaying it due to its size.

mjgiarlo commented 9 years ago

:clap:

Thanks, @gkellogg

gkellogg commented 9 years ago

Released as version 0.8.3 of the gem. Thanks for the contributions!

mjgiarlo commented 9 years ago

Back at you.

On Thu, May 21, 2015 at 11:33 AM Gregg Kellogg notifications@github.com wrote:

Released as version 0.8.3 of the gem. Thanks for the contributions!

— Reply to this email directly or view it on GitHub https://github.com/ruby-rdf/rdf-vocab/pull/18#issuecomment-104380181.