mida 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +8 -0
- data/{LICENSE.rdoc → LICENCE.rdoc} +1 -1
- data/README.rdoc +2 -2
- data/Rakefile +4 -3
- data/bin/mida +13 -3
- data/lib/mida.rb +2 -1
- data/lib/mida/datatype.rb +2 -0
- data/lib/mida/datatype/boolean.rb +21 -9
- data/lib/mida/datatype/enumeration.rb +28 -0
- data/lib/mida/datatype/float.rb +8 -5
- data/lib/mida/datatype/generic.rb +33 -0
- data/lib/mida/datatype/integer.rb +5 -5
- data/lib/mida/datatype/iso8601date.rb +12 -6
- data/lib/mida/datatype/number.rb +6 -5
- data/lib/mida/datatype/text.rb +5 -3
- data/lib/mida/datatype/url.rb +20 -0
- data/lib/mida/document.rb +4 -5
- data/lib/mida/item.rb +3 -4
- data/lib/mida/{genericvocabulary.rb → vocabularies/genericvocabulary.rb} +0 -0
- data/lib/mida/vocabularies/schemaorg.rb +1 -0
- data/lib/mida/vocabularies/schemaorg/aboutpage.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/accountingservice.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/administrativearea.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/adultentertainment.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/aggregateoffer.rb +34 -0
- data/lib/mida/vocabularies/schemaorg/aggregaterating.rb +33 -0
- data/lib/mida/vocabularies/schemaorg/airport.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/amusementpark.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/animalshelter.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/apartmentcomplex.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/aquarium.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/artgallery.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/article.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/attorney.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/audioobject.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/autobodyshop.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/autodealer.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/automatedteller.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/automotivebusiness.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/autopartsstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/autorental.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/autorepair.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/autowash.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/bakery.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/bankorcreditunion.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/barorpub.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/beach.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/beautysalon.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/bedandbreakfast.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/bikestore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/blog.rb +24 -0
- data/lib/mida/vocabularies/schemaorg/blogposting.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/bodyofwater.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/book.rb +41 -0
- data/lib/mida/vocabularies/schemaorg/bookformattype.rb +16 -0
- data/lib/mida/vocabularies/schemaorg/bookstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/bowlingalley.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/brewery.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/buddhisttemple.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/businessevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/busstation.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/busstop.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/cafeorcoffeeshop.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/campground.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/canal.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/casino.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/catholicchurch.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/cemetery.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/checkoutpage.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/childcare.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/childrensevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/church.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/city.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/cityhall.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/civicstructure.rb +24 -0
- data/lib/mida/vocabularies/schemaorg/clothingstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/collectionpage.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/collegeoruniversity.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/comedyclub.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/comedyevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/computerstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/contactpage.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/contactpoint.rb +27 -0
- data/lib/mida/vocabularies/schemaorg/continent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/conveniencestore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/corporation.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/country.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/courthouse.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/creativework.rb +122 -0
- data/lib/mida/vocabularies/schemaorg/crematorium.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/danceevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/dancegroup.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/dayspa.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/defenceestablishment.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/dentist.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/departmentstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/distance.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/drycleaningorlaundry.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/duration.rb +13 -0
- data/lib/mida/vocabularies/schemaorg/educationalorganization.rb +24 -0
- data/lib/mida/vocabularies/schemaorg/educationevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/electrician.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/electronicsstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/elementaryschool.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/embassy.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/emergencyservice.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/employmentagency.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/energy.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/entertainmentbusiness.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/enumeration.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/event.rb +77 -0
- data/lib/mida/vocabularies/schemaorg/eventvenue.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/exercisegym.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/fastfoodrestaurant.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/festival.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/financialservice.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/firestation.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/florist.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/foodestablishment.rb +36 -0
- data/lib/mida/vocabularies/schemaorg/foodevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/furniturestore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/gardenstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/gasstation.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/gatedresidencecommunity.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/generalcontractor.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/geocoordinates.rb +33 -0
- data/lib/mida/vocabularies/schemaorg/golfcourse.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/governmentbuilding.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/governmentoffice.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/governmentorganization.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/grocerystore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/hairsalon.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/hardwarestore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/healthandbeautybusiness.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/healthclub.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/highschool.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/hindutemple.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/hobbyshop.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/homeandconstructionbusiness.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/homegoodsstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/hospital.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/hostel.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/hotel.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/housepainter.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/hvacbusiness.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/icecreamshop.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/imagegallery.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/imageobject.rb +37 -0
- data/lib/mida/vocabularies/schemaorg/insuranceagency.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/intangible.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/internetcafe.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/itemavailability.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/itemlist.rb +20 -0
- data/lib/mida/vocabularies/schemaorg/itempage.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/jewelrystore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/lakebodyofwater.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/landform.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/landmarksorhistoricalbuildings.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/language.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/legislativebuilding.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/library.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/liquorstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/literaryevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/localbusiness.rb +41 -0
- data/lib/mida/vocabularies/schemaorg/locksmith.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/lodgingbusiness.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/map.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/mass.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/mediaobject.rb +87 -0
- data/lib/mida/vocabularies/schemaorg/medicalclinic.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/medicalorganization.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/mensclothingstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/middleschool.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/mobilephonestore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/mosque.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/motel.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/motorcycledealer.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/motorcyclerepair.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/mountain.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/movie.rb +65 -0
- data/lib/mida/vocabularies/schemaorg/movierentalstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/movietheater.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/movingcompany.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/museum.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/musicalbum.rb +26 -0
- data/lib/mida/vocabularies/schemaorg/musicevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/musicgroup.rb +38 -0
- data/lib/mida/vocabularies/schemaorg/musicplaylist.rb +29 -0
- data/lib/mida/vocabularies/schemaorg/musicrecording.rb +45 -0
- data/lib/mida/vocabularies/schemaorg/musicstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/musicvenue.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/musicvideoobject.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/nailsalon.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/newsarticle.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/ngo.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/nightclub.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/notary.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/nutritioninformation.rb +86 -0
- data/lib/mida/vocabularies/schemaorg/oceanbodyofwater.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/offer.rb +69 -0
- data/lib/mida/vocabularies/schemaorg/offeritemcondition.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/officeequipmentstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/optician.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/organization.rb +96 -0
- data/lib/mida/vocabularies/schemaorg/outletstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/painting.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/park.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/parkingfacility.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/pawnshop.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/performingartstheater.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/performinggroup.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/person.rb +164 -0
- data/lib/mida/vocabularies/schemaorg/petstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/pharmacy.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/photograph.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/physician.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/place.rb +80 -0
- data/lib/mida/vocabularies/schemaorg/placeofworship.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/playground.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/plumber.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/policestation.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/pond.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/postaladdress.rb +39 -0
- data/lib/mida/vocabularies/schemaorg/postoffice.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/preschool.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/product.rb +55 -0
- data/lib/mida/vocabularies/schemaorg/professionalservice.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/profilepage.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/publicswimmingpool.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/quantity.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/radiostation.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/rating.rb +30 -0
- data/lib/mida/vocabularies/schemaorg/realestateagent.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/recipe.rb +61 -0
- data/lib/mida/vocabularies/schemaorg/recyclingcenter.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/reservoir.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/residence.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/restaurant.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/review.rb +33 -0
- data/lib/mida/vocabularies/schemaorg/riverbodyofwater.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/roofingcontractor.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/rvpark.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/saleevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/scholarlyarticle.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/school.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/sculpture.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/seabodyofwater.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/searchresultspage.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/selfstorage.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/shoestore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/shoppingcenter.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/singlefamilyresidence.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/sitenavigationelement.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/skiresort.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/socialevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/sportinggoodsstore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/sportsactivitylocation.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/sportsclub.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/sportsevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/sportsteam.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/stadiumorarena.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/state.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/store.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/structuredvalue.rb +15 -0
- data/lib/mida/vocabularies/schemaorg/subwaystation.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/synagogue.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/table.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/tattooparlor.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/taxistand.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/televisionstation.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/tenniscomplex.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/theaterevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/theatergroup.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/thing.rb +29 -0
- data/lib/mida/vocabularies/schemaorg/tireshop.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/touristattraction.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/touristinformationcenter.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/toystore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/trainstation.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/travelagency.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/tvepisode.rb +77 -0
- data/lib/mida/vocabularies/schemaorg/tvseason.rb +58 -0
- data/lib/mida/vocabularies/schemaorg/tvseries.rb +87 -0
- data/lib/mida/vocabularies/schemaorg/userblocks.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/usercheckins.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/usercomments.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/userdownloads.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/userinteraction.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/userlikes.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/userpagevisits.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/userplays.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/userplusones.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/usertweets.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/veterinarycare.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/videogallery.rb +19 -0
- data/lib/mida/vocabularies/schemaorg/videoobject.rb +42 -0
- data/lib/mida/vocabularies/schemaorg/visualartsevent.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/volcano.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/waterfall.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/webpage.rb +46 -0
- data/lib/mida/vocabularies/schemaorg/webpageelement.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/wholesalestore.rb +21 -0
- data/lib/mida/vocabularies/schemaorg/winery.rb +23 -0
- data/lib/mida/vocabularies/schemaorg/wpadblock.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/wpfooter.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/wpheader.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/wpsidebar.rb +17 -0
- data/lib/mida/vocabularies/schemaorg/zoo.rb +19 -0
- data/lib/mida/vocabulary.rb +11 -6
- data/spec/datatype/boolean_spec.rb +21 -8
- data/spec/datatype/enumeration_spec.rb +30 -0
- data/spec/datatype/float_spec.rb +8 -10
- data/spec/datatype/generic_spec.rb +44 -0
- data/spec/datatype/integer_spec.rb +11 -8
- data/spec/datatype/iso8601date_spec.rb +15 -8
- data/spec/datatype/number_spec.rb +8 -10
- data/spec/datatype/text_spec.rb +8 -6
- data/spec/datatype/url_spec.rb +27 -0
- data/spec/document_spec.rb +0 -21
- data/spec/item_spec.rb +41 -48
- data/spec/vocabulary_spec.rb +51 -0
- metadata +316 -10
data/CHANGELOG.rdoc
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
== 0.3.3 (31st July 2011)
|
2
|
+
* Removed validation from +new+ for +Item+ and +Document+
|
3
|
+
* Created <tt>vocabularies/</tt> to put the vocabularies in
|
4
|
+
* Added +URL+ and +Enumeration+ <tt>DataType</tt>s
|
5
|
+
* Converted <tt>DataTypes</tt>s to classes derived from +Generic+
|
6
|
+
* Now supports circular dependencies in vocabularies
|
7
|
+
* Added all the <tt>Schema.org</tt> vocabularies
|
8
|
+
|
1
9
|
== 0.3.2 (9th July 2011)
|
2
10
|
* Ensure <tt>bin/mida</tt> only searches if type regexp passed
|
3
11
|
* Allow vocabularies to be included into other vocabularies
|
data/README.rdoc
CHANGED
@@ -131,6 +131,6 @@ If you find a bug or want to make a feature request, please report it at the
|
|
131
131
|
Mida project's {issues tracker}[https://github.com/LawrenceWoodman/mida/issues]
|
132
132
|
on github.
|
133
133
|
|
134
|
-
==
|
134
|
+
== Licence
|
135
135
|
Copyright (c) 2011 Lawrence Woodman.
|
136
|
-
This software is licensed under the MIT
|
136
|
+
This software is licensed under the MIT Licence. Please see the file, LICENCE.rdoc, for details.
|
data/Rakefile
CHANGED
@@ -5,8 +5,8 @@ require 'rubygems/package_task'
|
|
5
5
|
spec = Gem::Specification.new do |s|
|
6
6
|
s.name = "mida"
|
7
7
|
s.summary = "A Microdata parser/extractor library"
|
8
|
-
s.description = "A Microdata parser and extractor library
|
9
|
-
s.version = "0.3.
|
8
|
+
s.description = "A Microdata parser and extractor library which includes support for the schema.org vocabularies"
|
9
|
+
s.version = "0.3.3"
|
10
10
|
s.author = "Lawrence Woodman"
|
11
11
|
s.email = "lwoodman@vlifesystems.com"
|
12
12
|
s.homepage = %q{http://lawrencewoodman.github.com/mida/}
|
@@ -14,9 +14,10 @@ spec = Gem::Specification.new do |s|
|
|
14
14
|
s.required_ruby_version = '>=1.9'
|
15
15
|
s.files = Dir['lib/**/*.rb'] + Dir['spec/**/*.rb'] + Dir['*.rdoc'] + Dir['Rakefile']
|
16
16
|
s.executables = ['mida']
|
17
|
-
s.extra_rdoc_files = ['README.rdoc', '
|
17
|
+
s.extra_rdoc_files = ['README.rdoc', 'LICENCE.rdoc', 'CHANGELOG.rdoc']
|
18
18
|
s.rdoc_options << '--main' << 'README.rdoc'
|
19
19
|
s.add_dependency('nokogiri', '>= 1.5')
|
20
|
+
s.add_dependency('blankslate')
|
20
21
|
s.add_development_dependency('rspec', '>= 2.0' )
|
21
22
|
s.add_development_dependency('bundler')
|
22
23
|
end
|
data/bin/mida
CHANGED
@@ -32,7 +32,17 @@ rescue LoadError
|
|
32
32
|
raise
|
33
33
|
end
|
34
34
|
|
35
|
-
|
35
|
+
# Turn off validation by unregistering all the vocabularies apart from
|
36
|
+
# GenericVocabulary
|
37
|
+
def turnOffValidation
|
38
|
+
Mida::Vocabulary.vocabularies.each do |vocabulary|
|
39
|
+
unless vocabulary == Mida::GenericVocabulary
|
40
|
+
Mida::Vocabulary.unregister(vocabulary)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
options = {sourcename: true}
|
36
46
|
ARGV.options do |option|
|
37
47
|
option.banner = banner
|
38
48
|
option.on('-c','--count', 'Display the counts of each Microdata Type') do
|
@@ -47,7 +57,7 @@ ARGV.options do |option|
|
|
47
57
|
end
|
48
58
|
option.on('-v','--no-validate',
|
49
59
|
"Don't validate the items against known Vocabularies") do
|
50
|
-
|
60
|
+
turnOffValidation
|
51
61
|
end
|
52
62
|
option.on_tail('-h','--help', 'This help message') {puts option; exit}
|
53
63
|
|
@@ -84,7 +94,7 @@ def parse_source(source, options)
|
|
84
94
|
url = get_url
|
85
95
|
begin
|
86
96
|
open(source) do |f|
|
87
|
-
doc = Mida::Document.new(f, url
|
97
|
+
doc = Mida::Document.new(f, url)
|
88
98
|
items = if options[:type]
|
89
99
|
doc.search(options[:type])
|
90
100
|
else
|
data/lib/mida.rb
CHANGED
data/lib/mida/datatype.rb
CHANGED
@@ -8,8 +8,10 @@ module Mida
|
|
8
8
|
end
|
9
9
|
|
10
10
|
require 'mida/datatype/boolean'
|
11
|
+
require 'mida/datatype/enumeration'
|
11
12
|
require 'mida/datatype/float'
|
12
13
|
require 'mida/datatype/integer'
|
13
14
|
require 'mida/datatype/iso8601date'
|
14
15
|
require 'mida/datatype/number'
|
15
16
|
require 'mida/datatype/text'
|
17
|
+
require 'mida/datatype/url'
|
@@ -1,18 +1,30 @@
|
|
1
|
+
require 'mida/datatype/generic'
|
2
|
+
|
1
3
|
module Mida
|
2
4
|
module DataType
|
3
5
|
|
4
6
|
# Boolean data type
|
5
|
-
|
7
|
+
# Provides access to TrueClass/FalseClass methods
|
8
|
+
class Boolean < Generic
|
9
|
+
|
10
|
+
# Raises +ArgumentError+ if value not valid boolean
|
11
|
+
def initialize(value)
|
12
|
+
@parsedValue = case value.downcase
|
13
|
+
when 'true' then true
|
14
|
+
when 'false' then false
|
15
|
+
else raise ::ArgumentError, 'Invalid value'
|
16
|
+
end
|
17
|
+
end
|
6
18
|
|
7
|
-
|
8
|
-
|
9
|
-
def self.extract(value)
|
10
|
-
case value.downcase
|
11
|
-
when 'true' then true
|
12
|
-
when 'false' then false
|
13
|
-
else raise ArgumentError, 'Invalid value'
|
14
|
-
end
|
19
|
+
def to_s
|
20
|
+
@parsedValue.to_s.capitalize
|
15
21
|
end
|
22
|
+
|
23
|
+
def !@
|
24
|
+
!@parsedValue
|
25
|
+
end
|
26
|
+
|
16
27
|
end
|
28
|
+
|
17
29
|
end
|
18
30
|
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
require 'mida/datatype/generic'
|
2
|
+
require 'mida/datatype/url'
|
3
|
+
require 'uri'
|
4
|
+
|
5
|
+
module Mida
|
6
|
+
module DataType
|
7
|
+
|
8
|
+
# Enumeration data type
|
9
|
+
# Provides access to underly DataType methods
|
10
|
+
# Subclasses should implement VALID_VALUES as an array of the form:
|
11
|
+
# [[DataType, Regexp], [DataType, Regexp]]
|
12
|
+
class Enumeration < Generic
|
13
|
+
|
14
|
+
Enumeration.reveal(:class)
|
15
|
+
|
16
|
+
# Raises +ArgumentError+ if value not valid value
|
17
|
+
def initialize(value)
|
18
|
+
value_is_valid = self.class::VALID_VALUES.any? do |valid_value|
|
19
|
+
@parsedValue = valid_value[0].parse(value)
|
20
|
+
@parsedValue.to_s =~ valid_value[1]
|
21
|
+
end
|
22
|
+
raise ArgumentError unless value_is_valid
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
28
|
+
end
|
data/lib/mida/datatype/float.rb
CHANGED
@@ -1,15 +1,18 @@
|
|
1
|
+
require 'mida/datatype/generic'
|
2
|
+
|
1
3
|
module Mida
|
2
4
|
module DataType
|
3
5
|
|
4
6
|
# Float data type
|
5
|
-
|
7
|
+
# Provides access to Float methods
|
8
|
+
class Float < Generic
|
6
9
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
Float(value)
|
10
|
+
# Raises +ArgumentError+ if value not valid
|
11
|
+
def initialize(value)
|
12
|
+
@parsedValue = ::Kernel.Float(value)
|
11
13
|
end
|
12
14
|
|
13
15
|
end
|
16
|
+
|
14
17
|
end
|
15
18
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'blankslate'
|
2
|
+
|
3
|
+
module Mida
|
4
|
+
module DataType
|
5
|
+
|
6
|
+
# The base DataType Parser
|
7
|
+
class Generic < BlankSlate
|
8
|
+
|
9
|
+
# Convenience method, same as +new+
|
10
|
+
def self.parse(value)
|
11
|
+
self.new(value)
|
12
|
+
end
|
13
|
+
|
14
|
+
def method_missing(name, *args, &block)
|
15
|
+
@parsedValue.send(name, *args, &block)
|
16
|
+
end
|
17
|
+
|
18
|
+
def to_s
|
19
|
+
@parsedValue.to_s
|
20
|
+
end
|
21
|
+
|
22
|
+
def to_yaml(options={})
|
23
|
+
to_s.to_yaml(options)
|
24
|
+
end
|
25
|
+
|
26
|
+
def ==(other)
|
27
|
+
@parsedValue.to_s.downcase == other.to_s.downcase
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
@@ -2,12 +2,12 @@ module Mida
|
|
2
2
|
module DataType
|
3
3
|
|
4
4
|
# Integer data type
|
5
|
-
|
5
|
+
# Provides access to Integer methods
|
6
|
+
class Integer < Generic
|
6
7
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
Integer(value)
|
8
|
+
# Raises +ArgumentError+ if value not valid
|
9
|
+
def initialize(value)
|
10
|
+
@parsedValue = ::Kernel.Integer(value)
|
11
11
|
end
|
12
12
|
|
13
13
|
end
|
@@ -1,17 +1,23 @@
|
|
1
|
+
require 'mida/datatype/generic'
|
1
2
|
require 'date'
|
2
3
|
|
3
4
|
module Mida
|
4
5
|
module DataType
|
5
6
|
|
6
7
|
# ISO 8601 Date data type
|
7
|
-
|
8
|
+
# Provides access to DateTime methods
|
9
|
+
class ISO8601Date < Generic
|
8
10
|
|
9
|
-
#
|
10
|
-
|
11
|
-
|
12
|
-
def self.extract(value)
|
13
|
-
DateTime.iso8601(value)
|
11
|
+
# Raises +ArgumentError+ if value not valid
|
12
|
+
def initialize(value)
|
13
|
+
@parsedValue = ::DateTime.iso8601(value)
|
14
14
|
end
|
15
|
+
|
16
|
+
def to_s
|
17
|
+
@parsedValue.rfc822
|
18
|
+
end
|
19
|
+
|
15
20
|
end
|
21
|
+
|
16
22
|
end
|
17
23
|
end
|
data/lib/mida/datatype/number.rb
CHANGED
@@ -2,14 +2,15 @@ module Mida
|
|
2
2
|
module DataType
|
3
3
|
|
4
4
|
# Number data type
|
5
|
-
|
5
|
+
# Provides access to Float methods
|
6
|
+
class Number < Generic
|
6
7
|
|
7
|
-
#
|
8
|
-
|
9
|
-
|
10
|
-
Float(value)
|
8
|
+
# Raises +ArgumentError+ if value not valid
|
9
|
+
def initialize(value)
|
10
|
+
@parsedValue = ::Kernel.Float(value)
|
11
11
|
end
|
12
12
|
|
13
13
|
end
|
14
|
+
|
14
15
|
end
|
15
16
|
end
|
data/lib/mida/datatype/text.rb
CHANGED
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'mida/datatype/generic'
|
2
|
+
require 'uri'
|
3
|
+
|
4
|
+
module Mida
|
5
|
+
module DataType
|
6
|
+
|
7
|
+
# URL data type
|
8
|
+
# Provides access to URI methods
|
9
|
+
class URL < Generic
|
10
|
+
|
11
|
+
# Raises +ArgumentError+ if value not valid url
|
12
|
+
def initialize(value)
|
13
|
+
raise ::ArgumentError unless value =~ ::URI::DEFAULT_PARSER.regexp[:ABS_URI]
|
14
|
+
@parsedValue = ::URI.parse(value)
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
data/lib/mida/document.rb
CHANGED
@@ -15,11 +15,10 @@ module Mida
|
|
15
15
|
# [target] The string containing the html that you want to parse.
|
16
16
|
# [page_url] The url of target used for form absolute urls. This must
|
17
17
|
# include the filename, e.g. index.html.
|
18
|
-
|
19
|
-
def initialize(target, page_url=nil, validate=true)
|
18
|
+
def initialize(target, page_url=nil)
|
20
19
|
@doc = Nokogiri(target)
|
21
20
|
@page_url = page_url
|
22
|
-
@items = extract_items
|
21
|
+
@items = extract_items
|
23
22
|
end
|
24
23
|
|
25
24
|
# Implements method for Enumerable
|
@@ -46,13 +45,13 @@ module Mida
|
|
46
45
|
end
|
47
46
|
|
48
47
|
private
|
49
|
-
def extract_items
|
48
|
+
def extract_items
|
50
49
|
itemscopes = @doc.search('//*[@itemscope and not(@itemprop)]')
|
51
50
|
return nil unless itemscopes
|
52
51
|
|
53
52
|
itemscopes.collect do |itemscope|
|
54
53
|
itemscope = Itemscope.new(itemscope, @page_url)
|
55
|
-
Item.new(itemscope
|
54
|
+
Item.new(itemscope)
|
56
55
|
end
|
57
56
|
end
|
58
57
|
|
data/lib/mida/item.rb
CHANGED
@@ -24,13 +24,12 @@ module Mida
|
|
24
24
|
# its +properties+
|
25
25
|
#
|
26
26
|
# [itemscope] The itemscope that has been parsed by +Itemscope+
|
27
|
-
|
28
|
-
def initialize(itemscope, validate=true)
|
27
|
+
def initialize(itemscope)
|
29
28
|
@type = itemscope.type
|
30
29
|
@id = itemscope.id
|
31
30
|
@vocabulary = Mida::Vocabulary.find(@type)
|
32
31
|
@properties = itemscope.properties
|
33
|
-
validate_properties
|
32
|
+
validate_properties
|
34
33
|
end
|
35
34
|
|
36
35
|
# Return a Hash representation
|
@@ -149,7 +148,7 @@ module Mida
|
|
149
148
|
def datatype_extract(valid_types, value)
|
150
149
|
valid_types.find do |type|
|
151
150
|
begin
|
152
|
-
return type.
|
151
|
+
return type.parse(value) if type.respond_to?(:parse)
|
153
152
|
rescue ArgumentError
|
154
153
|
end
|
155
154
|
end
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
Dir.glob(File.dirname(__FILE__) + '/schemaorg/*.rb') {|file| require file}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mida/vocabulary'
|
2
|
+
|
3
|
+
module Mida
|
4
|
+
module SchemaOrg
|
5
|
+
|
6
|
+
autoload :Thing, 'mida/vocabularies/schemaorg/thing'
|
7
|
+
autoload :CreativeWork, 'mida/vocabularies/schemaorg/creativework'
|
8
|
+
autoload :WebPage, 'mida/vocabularies/schemaorg/webpage'
|
9
|
+
|
10
|
+
# Web page type: About page.
|
11
|
+
class AboutPage < Mida::Vocabulary
|
12
|
+
itemtype %r{http://schema.org/AboutPage}i
|
13
|
+
include_vocabulary Mida::SchemaOrg::Thing
|
14
|
+
include_vocabulary Mida::SchemaOrg::CreativeWork
|
15
|
+
include_vocabulary Mida::SchemaOrg::WebPage
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'mida/vocabulary'
|
2
|
+
|
3
|
+
module Mida
|
4
|
+
module SchemaOrg
|
5
|
+
|
6
|
+
autoload :Thing, 'mida/vocabularies/schemaorg/thing'
|
7
|
+
autoload :Place, 'mida/vocabularies/schemaorg/place'
|
8
|
+
autoload :Organization, 'mida/vocabularies/schemaorg/organization'
|
9
|
+
autoload :LocalBusiness, 'mida/vocabularies/schemaorg/localbusiness'
|
10
|
+
|
11
|
+
# Accountancy business.
|
12
|
+
class AccountingService < Mida::Vocabulary
|
13
|
+
itemtype %r{http://schema.org/AccountingService}i
|
14
|
+
include_vocabulary Mida::SchemaOrg::Thing
|
15
|
+
include_vocabulary Mida::SchemaOrg::Place
|
16
|
+
include_vocabulary Mida::SchemaOrg::Organization
|
17
|
+
include_vocabulary Mida::SchemaOrg::LocalBusiness
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
end
|