mida_vocabulary 0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +9 -0
- data/Rakefile +7 -0
- data/lib/mida_vocabulary/datatype/boolean.rb +30 -0
- data/lib/mida_vocabulary/datatype/enumeration.rb +28 -0
- data/lib/mida_vocabulary/datatype/float.rb +18 -0
- data/lib/mida_vocabulary/datatype/generic.rb +33 -0
- data/lib/mida_vocabulary/datatype/integer.rb +15 -0
- data/lib/mida_vocabulary/datatype/iso8601date.rb +25 -0
- data/lib/mida_vocabulary/datatype/number.rb +16 -0
- data/lib/mida_vocabulary/datatype/text.rb +15 -0
- data/lib/mida_vocabulary/datatype/url.rb +20 -0
- data/lib/mida_vocabulary/datatype.rb +17 -0
- data/lib/mida_vocabulary/propertydesc.rb +36 -0
- data/lib/mida_vocabulary/vocabularies/genericvocabulary.rb +13 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/aboutpage.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/accountingservice.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/administrativearea.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/adultentertainment.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/aggregateoffer.rb +34 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/aggregaterating.rb +33 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/airport.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/amusementpark.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/animalshelter.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/apartmentcomplex.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/aquarium.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/artgallery.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/article.rb +28 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/attorney.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/audioobject.rb +22 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/autobodyshop.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/autodealer.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/automatedteller.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/automotivebusiness.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/autopartsstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/autorental.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/autorepair.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/autowash.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bakery.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bankorcreditunion.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/barorpub.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/beach.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/beautysalon.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bedandbreakfast.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bikestore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/blog.rb +24 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/blogposting.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bodyofwater.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/book.rb +41 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bookformattype.rb +16 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bookstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/bowlingalley.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/brewery.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/buddhisttemple.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/businessevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/busstation.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/busstop.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/cafeorcoffeeshop.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/campground.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/canal.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/casino.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/catholicchurch.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/cemetery.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/checkoutpage.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/childcare.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/childrensevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/church.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/city.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/cityhall.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/civicstructure.rb +24 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/clothingstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/collectionpage.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/collegeoruniversity.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/comedyclub.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/comedyevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/computerstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/contactpage.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/contactpoint.rb +27 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/continent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/conveniencestore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/corporation.rb +20 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/country.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/courthouse.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/creativework.rb +219 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/crematorium.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/danceevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/dancegroup.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/dayspa.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/defenceestablishment.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/dentist.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/departmentstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/distance.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/drycleaningorlaundry.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/duration.rb +13 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/educationalorganization.rb +24 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/educationevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/electrician.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/electronicsstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/elementaryschool.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/embassy.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/emergencyservice.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/employmentagency.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/energy.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/entertainmentbusiness.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/enumeration.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/event.rb +77 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/eventvenue.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/exercisegym.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/fastfoodrestaurant.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/festival.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/financialservice.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/firestation.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/florist.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/foodestablishment.rb +36 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/foodevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/furniturestore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/gardenstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/gasstation.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/gatedresidencecommunity.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/generalcontractor.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/geocoordinates.rb +33 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/geoshape.rb +33 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/golfcourse.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/governmentbuilding.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/governmentoffice.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/governmentorganization.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/grocerystore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hairsalon.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hardwarestore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/healthandbeautybusiness.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/healthclub.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/highschool.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hindutemple.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hobbyshop.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/homeandconstructionbusiness.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/homegoodsstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hospital.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hostel.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hotel.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/housepainter.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/hvacbusiness.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/icecreamshop.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/imagegallery.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/imageobject.rb +37 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/insuranceagency.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/intangible.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/internetcafe.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/itemavailability.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/itemlist.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/itempage.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/jewelrystore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/jobposting.rb +81 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/lakebodyofwater.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/landform.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/landmarksorhistoricalbuildings.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/language.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/legislativebuilding.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/library.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/liquorstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/literaryevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/localbusiness.rb +41 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/locksmith.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/lodgingbusiness.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/map.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/mass.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/mediaobject.rb +94 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/medicalclinic.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/medicalorganization.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/mensclothingstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/middleschool.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/mobilephonestore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/mosque.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/motel.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/motorcycledealer.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/motorcyclerepair.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/mountain.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/movie.rb +65 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/movierentalstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/movietheater.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/movingcompany.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/museum.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicalbum.rb +26 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicgroup.rb +38 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicplaylist.rb +29 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicrecording.rb +45 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicvenue.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/musicvideoobject.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/nailsalon.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/newsarticle.rb +34 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/ngo.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/nightclub.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/notary.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/nutritioninformation.rb +86 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/oceanbodyofwater.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/offer.rb +69 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/offeritemcondition.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/officeequipmentstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/optician.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/organization.rb +96 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/outletstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/painting.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/park.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/parkingfacility.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/pawnshop.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/performingartstheater.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/performinggroup.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/person.rb +179 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/petstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/pharmacy.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/photograph.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/physician.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/place.rb +82 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/placeofworship.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/playground.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/plumber.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/policestation.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/pond.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/postaladdress.rb +39 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/postoffice.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/preschool.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/product.rb +55 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/professionalservice.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/profilepage.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/publicswimmingpool.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/quantity.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/radiostation.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/rating.rb +30 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/realestateagent.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/recipe.rb +61 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/recyclingcenter.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/reservoir.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/residence.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/restaurant.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/review.rb +33 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/riverbodyofwater.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/roofingcontractor.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/rvpark.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/saleevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/scholarlyarticle.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/school.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/sculpture.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/seabodyofwater.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/searchresultspage.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/selfstorage.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/shoestore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/shoppingcenter.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/singlefamilyresidence.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/sitenavigationelement.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/skiresort.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/socialevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/sportinggoodsstore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/sportsactivitylocation.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/sportsclub.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/sportsevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/sportsteam.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/stadiumorarena.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/state.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/store.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/structuredvalue.rb +15 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/subwaystation.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/synagogue.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/table.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/tattooparlor.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/taxistand.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/televisionstation.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/tenniscomplex.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/theaterevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/theatergroup.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/thing.rb +29 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/tireshop.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/touristattraction.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/touristinformationcenter.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/toystore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/trainstation.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/travelagency.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/tvepisode.rb +77 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/tvseason.rb +58 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/tvseries.rb +87 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/userblocks.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/usercheckins.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/usercomments.rb +46 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/userdownloads.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/userinteraction.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/userlikes.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/userpagevisits.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/userplays.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/userplusones.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/usertweets.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/veterinarycare.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/videogallery.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/videoobject.rb +45 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/visualartsevent.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/volcano.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/waterfall.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/webpage.rb +46 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/webpageelement.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/wholesalestore.rb +21 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/winery.rb +23 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/wpadblock.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/wpfooter.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/wpheader.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/wpsidebar.rb +17 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg/zoo.rb +19 -0
- data/lib/mida_vocabulary/vocabularies/schemaorg.rb +1 -0
- data/lib/mida_vocabulary/vocabulary.rb +109 -0
- data/lib/mida_vocabulary.rb +10 -0
- data/spec/datatype/boolean_spec.rb +40 -0
- data/spec/datatype/enumeration_spec.rb +30 -0
- data/spec/datatype/float_spec.rb +21 -0
- data/spec/datatype/generic_spec.rb +44 -0
- data/spec/datatype/integer_spec.rb +26 -0
- data/spec/datatype/iso8601date_spec.rb +27 -0
- data/spec/datatype/number_spec.rb +21 -0
- data/spec/datatype/text_spec.rb +16 -0
- data/spec/datatype/url_spec.rb +27 -0
- data/spec/propertydesc_spec.rb +56 -0
- data/spec/spec_helper.rb +18 -0
- data/spec/vocabulary_spec.rb +271 -0
- metadata +397 -0
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'mida_vocabulary/vocabulary'
|
2
|
+
|
3
|
+
module Mida
|
4
|
+
module SchemaOrg
|
5
|
+
|
6
|
+
autoload :Thing, 'mida_vocabulary/vocabularies/schemaorg/thing'
|
7
|
+
autoload :CreativeWork, 'mida_vocabulary/vocabularies/schemaorg/creativework'
|
8
|
+
|
9
|
+
# A sidebar section of the page.
|
10
|
+
class WPSideBar < Mida::Vocabulary
|
11
|
+
itemtype %r{http://schema.org/WPSideBar}i
|
12
|
+
include_vocabulary Mida::SchemaOrg::Thing
|
13
|
+
include_vocabulary Mida::SchemaOrg::CreativeWork
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'mida_vocabulary/vocabulary'
|
2
|
+
|
3
|
+
module Mida
|
4
|
+
module SchemaOrg
|
5
|
+
|
6
|
+
autoload :Thing, 'mida_vocabulary/vocabularies/schemaorg/thing'
|
7
|
+
autoload :Place, 'mida_vocabulary/vocabularies/schemaorg/place'
|
8
|
+
autoload :CivicStructure, 'mida_vocabulary/vocabularies/schemaorg/civicstructure'
|
9
|
+
|
10
|
+
# A zoo.
|
11
|
+
class Zoo < Mida::Vocabulary
|
12
|
+
itemtype %r{http://schema.org/Zoo}i
|
13
|
+
include_vocabulary Mida::SchemaOrg::Thing
|
14
|
+
include_vocabulary Mida::SchemaOrg::Place
|
15
|
+
include_vocabulary Mida::SchemaOrg::CivicStructure
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
Dir.glob(File.dirname(__FILE__) + '/schemaorg/*.rb') {|file| require file}
|
@@ -0,0 +1,109 @@
|
|
1
|
+
require 'set'
|
2
|
+
module Mida
|
3
|
+
|
4
|
+
# Class used to describe a vocabulary
|
5
|
+
#
|
6
|
+
# To specify a vocabulary use the following methods:
|
7
|
+
# +itemtype+, +has_one+, +has_many+
|
8
|
+
class Vocabulary
|
9
|
+
|
10
|
+
class << self
|
11
|
+
# Return the registered vocabularies
|
12
|
+
attr_reader :vocabularies
|
13
|
+
end
|
14
|
+
|
15
|
+
@vocabularies = Set.new
|
16
|
+
|
17
|
+
# Register a vocabulary that can be used when parsing,
|
18
|
+
# later vocabularies are given precedence over earlier ones
|
19
|
+
def self.register(vocabulary)
|
20
|
+
@vocabularies << vocabulary
|
21
|
+
end
|
22
|
+
|
23
|
+
# Un-register a vocabulary
|
24
|
+
def self.unregister(vocabulary)
|
25
|
+
@vocabularies.delete(vocabulary)
|
26
|
+
end
|
27
|
+
|
28
|
+
# Find the last vocabulary registered that matches the itemtype
|
29
|
+
def self.find(itemtype)
|
30
|
+
@vocabularies.sort_by {|v| v.itemtype ? v.itemtype.source.size : 0 }.reverse.each do |vocabulary|
|
31
|
+
if ((itemtype || "") =~ vocabulary.itemtype)
|
32
|
+
return vocabulary
|
33
|
+
end
|
34
|
+
end
|
35
|
+
nil
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.inherited(subclass)
|
39
|
+
register(subclass)
|
40
|
+
end
|
41
|
+
|
42
|
+
# Return the properties specification
|
43
|
+
# This won't work properly until all the included_vocabularies
|
44
|
+
# have finished being defined in case of circular dependancies
|
45
|
+
def self.properties
|
46
|
+
return @properties if @properties
|
47
|
+
@properties = @this_properties || {}
|
48
|
+
included_vocabularies.each do |vocabulary|
|
49
|
+
@properties.merge!(vocabulary.properties)
|
50
|
+
end
|
51
|
+
@properties
|
52
|
+
end
|
53
|
+
|
54
|
+
# Return the included vocabularies
|
55
|
+
def self.included_vocabularies
|
56
|
+
@included_vocabularies ||= Set.new
|
57
|
+
end
|
58
|
+
|
59
|
+
# Specify which +vocabularies+ will have their properties included.
|
60
|
+
# This is the correct way to inherit properties from another vocabulary,
|
61
|
+
# rather than subclassing.
|
62
|
+
def self.include_vocabulary(*vocabularies)
|
63
|
+
vocabularies.each do |vocabulary|
|
64
|
+
included_vocabularies.merge(vocabulary.included_vocabularies)
|
65
|
+
included_vocabularies << vocabulary
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
# As per the standard <tt>kind_of?</tt>, but also checks to see if vocabulary has
|
70
|
+
# been included by self
|
71
|
+
def self.kind_of?(vocabulary)
|
72
|
+
return true if self == vocabulary
|
73
|
+
return true if self.ancestors.include?(vocabulary)
|
74
|
+
included_vocabularies.include?(vocabulary)
|
75
|
+
end
|
76
|
+
|
77
|
+
# Sets the regular expression to match against the +itemtype+
|
78
|
+
# or returns the current regular expression
|
79
|
+
def self.itemtype(regexp=nil)
|
80
|
+
return @itemtype unless regexp
|
81
|
+
@itemtype = regexp
|
82
|
+
end
|
83
|
+
|
84
|
+
# Defines the properties as only containing one value
|
85
|
+
# If want to say any property name, then use +:any+ as a name
|
86
|
+
# Within a block you can use the methods of the class +PropertyDesc+
|
87
|
+
def self.has_one(*property_names, &block)
|
88
|
+
has(:one, *property_names, &block)
|
89
|
+
end
|
90
|
+
|
91
|
+
# Defines the properties as containing many values
|
92
|
+
# If want to say any property name, then use +:any+ as a name
|
93
|
+
# Within a block you can use the methods of the class +PropertyDesc+
|
94
|
+
def self.has_many(*property_names, &block)
|
95
|
+
has(:many, *property_names, &block)
|
96
|
+
end
|
97
|
+
|
98
|
+
def self.has(num, *property_names, &block)
|
99
|
+
@this_properties ||= {}
|
100
|
+
property_names.each_with_object(@this_properties) do |name, properties|
|
101
|
+
property_desc = PropertyDesc.new(num, &block)
|
102
|
+
properties[name] = property_desc.to_h
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
private_class_method :has
|
107
|
+
|
108
|
+
end
|
109
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
$LOAD_PATH.unshift File.dirname(__FILE__)
|
2
|
+
Dir[File.dirname(__FILE__) + '/mida_vocabulary/*.rb'].each { |f| require f }
|
3
|
+
|
4
|
+
# Mida is a Microdata parser and extractor.
|
5
|
+
module Mida
|
6
|
+
|
7
|
+
end
|
8
|
+
|
9
|
+
require 'mida_vocabulary/vocabularies/genericvocabulary'
|
10
|
+
require 'mida_vocabulary/vocabularies/schemaorg'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
|
3
|
+
describe Mida::DataType::Boolean do
|
4
|
+
|
5
|
+
it '#parse should raise an exception if a invalid text passed' do
|
6
|
+
test = lambda {Mida::DataType::Boolean.parse('example')}
|
7
|
+
test.should raise_error(ArgumentError)
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#parse should raise an exception if value is empty' do
|
11
|
+
test = lambda {Mida::DataType::Boolean.parse('')}
|
12
|
+
test.should raise_error(ArgumentError)
|
13
|
+
end
|
14
|
+
|
15
|
+
it '#parse should return true for "True" whatever the case' do
|
16
|
+
['true', 'True', 'TRUE', 'tRUE'].each do |true_text|
|
17
|
+
Mida::DataType::Boolean.parse(true_text).should be_true
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
it '#parse should return false for "False" whatever the case' do
|
22
|
+
['false', 'False', 'FALSE', 'fALSE'].each do |false_text|
|
23
|
+
Mida::DataType::Boolean.parse(false_text).should be_false
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
it '#to_s should return proper string representation of boolean' do
|
28
|
+
Mida::DataType::Boolean.parse('fALSE').to_s.should == 'False'
|
29
|
+
Mida::DataType::Boolean.parse('tRUE').to_s.should == 'True'
|
30
|
+
end
|
31
|
+
|
32
|
+
it '! should negate as if a TrueClass/FalseClass' do
|
33
|
+
true_boolean = Mida::DataType::Boolean.parse('true')
|
34
|
+
false_boolean = Mida::DataType::Boolean.parse('false')
|
35
|
+
|
36
|
+
(!true_boolean).should be_false
|
37
|
+
(!false_boolean).should be_true
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
require 'mida_vocabulary/datatype/url'
|
3
|
+
|
4
|
+
describe Mida::DataType::Enumeration do
|
5
|
+
before :all do
|
6
|
+
class BookType < Mida::DataType::Enumeration
|
7
|
+
VALID_VALUES = [
|
8
|
+
[::Mida::DataType::URL, %r{http://example.com/ebook}i],
|
9
|
+
[::Mida::DataType::URL, %r{http://example.com/paperback}i]
|
10
|
+
]
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it '#parse should raise an exception if an invalid url passed' do
|
15
|
+
test = lambda {BookType.parse('http://example.com/hardback')}
|
16
|
+
test.should raise_error(ArgumentError)
|
17
|
+
end
|
18
|
+
|
19
|
+
it '#parse should raise an exception if value is empty' do
|
20
|
+
test = lambda {BookType.parse('')}
|
21
|
+
test.should raise_error(ArgumentError)
|
22
|
+
end
|
23
|
+
|
24
|
+
it '#parse should accept a valid value' do
|
25
|
+
url_text = 'http://example.com/ebook'
|
26
|
+
url = BookType.parse(url_text)
|
27
|
+
url.to_s.should == url_text
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
|
3
|
+
describe Mida::DataType::Float do
|
4
|
+
|
5
|
+
it '#parse should raise an exception if not a number' do
|
6
|
+
test = lambda {Mida::DataType::Float.parse('hello')}
|
7
|
+
test.should raise_error(ArgumentError)
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#parse should raise an exception if value is empty' do
|
11
|
+
test = lambda {Mida::DataType::Float.parse('')}
|
12
|
+
test.should raise_error(ArgumentError)
|
13
|
+
end
|
14
|
+
|
15
|
+
it '#parse should accept a valid number' do
|
16
|
+
float_text = '3.14'
|
17
|
+
float = Mida::DataType::Float.parse(float_text)
|
18
|
+
float.to_s.should == float_text
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
|
3
|
+
describe Mida::DataType::Generic do
|
4
|
+
|
5
|
+
before do
|
6
|
+
class Number < Mida::DataType::Generic
|
7
|
+
def initialize(value)
|
8
|
+
@parsedValue = Float(value)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
it '#parse should provide pass value straight to #new' do
|
14
|
+
number = Number.parse('2.34')
|
15
|
+
number == 2.34
|
16
|
+
end
|
17
|
+
|
18
|
+
it "should provide access to the underlying type's methods" do
|
19
|
+
number = Number.new('2.34')
|
20
|
+
number.floor.should == 2
|
21
|
+
end
|
22
|
+
|
23
|
+
it '#to_s should use the underlying types #to_s method' do
|
24
|
+
number = Number.parse('2.34')
|
25
|
+
number.to_s.should == '2.34'
|
26
|
+
end
|
27
|
+
|
28
|
+
it '#to_yaml should provide a yaml representation of the items #to_s method' do
|
29
|
+
number = Number.parse('2.34')
|
30
|
+
number.to_yaml.should =~ /---\s+['"]2.34['"]\n/
|
31
|
+
end
|
32
|
+
|
33
|
+
it '#== should match against underlying type, string representation and self' do
|
34
|
+
number = Number.new('2.34')
|
35
|
+
(number == 2.34).should be_true
|
36
|
+
(number == '2.34').should be_true
|
37
|
+
(number == number).should be_true
|
38
|
+
|
39
|
+
(number == 2.44).should be_false
|
40
|
+
(number == '2.44').should be_false
|
41
|
+
(number == Number.new('2.44')).should be_false
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
|
3
|
+
describe Mida::DataType::Integer do
|
4
|
+
|
5
|
+
it '#parse should raise an exception if not a number' do
|
6
|
+
test = lambda {Mida::DataType::Integer.parse('hello')}
|
7
|
+
test.should raise_error(ArgumentError)
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#parse should raise an exception if not an integer' do
|
11
|
+
test = lambda {Mida::DataType::Integer.parse('3.14')}
|
12
|
+
test.should raise_error(ArgumentError)
|
13
|
+
end
|
14
|
+
|
15
|
+
it '#parse should raise an exception if value is empty' do
|
16
|
+
test = lambda {Mida::DataType::Integer.parse('')}
|
17
|
+
test.should raise_error(ArgumentError)
|
18
|
+
end
|
19
|
+
|
20
|
+
it '#parse should accept a valid number' do
|
21
|
+
integer_text = '3'
|
22
|
+
integer = Mida::DataType::Integer.parse(integer_text)
|
23
|
+
integer.to_s.should == integer_text
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
|
3
|
+
describe Mida::DataType::ISO8601Date do
|
4
|
+
|
5
|
+
it '#parse should raise an exception if invalid date format' do
|
6
|
+
test = lambda {Mida::DataType::ISO8601Date.parse('27th August 2009')}
|
7
|
+
test.should raise_error(ArgumentError)
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#parse should raise an exception if value is empty' do
|
11
|
+
test = lambda {Mida::DataType::ISO8601Date.parse('')}
|
12
|
+
test.should raise_error(ArgumentError)
|
13
|
+
end
|
14
|
+
|
15
|
+
context 'when passed a valid date' do
|
16
|
+
before do
|
17
|
+
@date_text = "2009-08-27T01:13:04+05:10"
|
18
|
+
@date = Mida::DataType::ISO8601Date.parse(@date_text)
|
19
|
+
end
|
20
|
+
|
21
|
+
it '#to_s should return the date as an rfc822 text string' do
|
22
|
+
@date.to_s.should == "Thu, 27 Aug 2009 01:13:04 +0510"
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
|
3
|
+
describe Mida::DataType::Number do
|
4
|
+
|
5
|
+
it '#parse should raise an exception if not a number' do
|
6
|
+
test = lambda {Mida::DataType::Number.parse('hello')}
|
7
|
+
test.should raise_error(ArgumentError)
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#parse should raise an exception if value is empty' do
|
11
|
+
test = lambda {Mida::DataType::Number.parse('')}
|
12
|
+
test.should raise_error(ArgumentError)
|
13
|
+
end
|
14
|
+
|
15
|
+
it '#parse should accept a valid number' do
|
16
|
+
num_text = '3.14'
|
17
|
+
num = Mida::DataType::Number.parse(num_text)
|
18
|
+
num.to_s.should == num_text
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
|
3
|
+
describe Mida::DataType::Text do
|
4
|
+
|
5
|
+
it '#parse should accept an empty string' do
|
6
|
+
text = Mida::DataType::Text.parse('')
|
7
|
+
text.should == ''
|
8
|
+
end
|
9
|
+
|
10
|
+
it '#parse should return the input value' do
|
11
|
+
test_text = 'Some text'
|
12
|
+
text = Mida::DataType::Text.parse(test_text)
|
13
|
+
text.should == test_text
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'mida_vocabulary/datatype'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
describe Mida::DataType::URL do
|
5
|
+
|
6
|
+
it '#parse should raise an exception if a bad url passed' do
|
7
|
+
test = lambda {Mida::DataType::URL.parse('example.com')}
|
8
|
+
test.should raise_error(ArgumentError)
|
9
|
+
end
|
10
|
+
|
11
|
+
it '#parse should raise an exception if value is empty' do
|
12
|
+
test = lambda {Mida::DataType::URL.parse('')}
|
13
|
+
test.should raise_error(ArgumentError)
|
14
|
+
end
|
15
|
+
|
16
|
+
it '#parse should accept a valid url' do
|
17
|
+
url_text = 'http://example.com/test/'
|
18
|
+
url = Mida::DataType::URL.parse(url_text)
|
19
|
+
url.to_s.should == url_text
|
20
|
+
end
|
21
|
+
|
22
|
+
|
23
|
+
it '#parse should accept a valid url' do
|
24
|
+
url_text = 'http://example.com/test/'
|
25
|
+
url = Mida::DataType::URL.parse(url_text)
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'mida_vocabulary/propertydesc'
|
3
|
+
|
4
|
+
describe Mida::PropertyDesc, 'when initialized without a block' do
|
5
|
+
before do
|
6
|
+
@propertyDesc = Mida::PropertyDesc.new(3)
|
7
|
+
end
|
8
|
+
|
9
|
+
it '#to_h[:num] should equal num passed' do
|
10
|
+
@propertyDesc.to_h[:num].should == 3
|
11
|
+
end
|
12
|
+
|
13
|
+
it '#to_h[:types] should equal DataType::Text' do
|
14
|
+
@propertyDesc.to_h[:types].should == [Mida::DataType::Text]
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe Mida::PropertyDesc, 'when initialized with a block with no specified types' do
|
19
|
+
before do
|
20
|
+
@propertyDesc = Mida::PropertyDesc.new(3) {}
|
21
|
+
end
|
22
|
+
|
23
|
+
it '#to_h[:types] should equal DataType::Text' do
|
24
|
+
@propertyDesc.to_h[:types].should == [Mida::DataType::Text]
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe Mida::PropertyDesc, 'when initialized with a block that specifies types with extract()' do
|
29
|
+
before do
|
30
|
+
@propertyDesc = Mida::PropertyDesc.new(3) { extract String, Array}
|
31
|
+
end
|
32
|
+
|
33
|
+
it '#to_h[:types] should equal [String, Array]' do
|
34
|
+
@propertyDesc.to_h[:types].should == [String, Array]
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
describe Mida::PropertyDesc, 'when initialized with a block that specifies types with types()' do
|
39
|
+
before do
|
40
|
+
@propertyDesc = nil
|
41
|
+
@error = last_stderr do
|
42
|
+
@propertyDesc = Mida::PropertyDesc.new(3) { types String, Array}
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
it 'should warn on initialization if types() is used in the block' do
|
47
|
+
@error.should eq("[DEPRECATION] Mida::PropertyDesc#types is deprecated. "+
|
48
|
+
"Please use Mida::PropertyDesc#extract instead."
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
it '#to_h[:types] should equal [String, Array]' do
|
53
|
+
@propertyDesc.to_h[:types].should == [String, Array]
|
54
|
+
end
|
55
|
+
|
56
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'bundler/setup'
|
2
|
+
require 'rspec'
|
3
|
+
|
4
|
+
def html_wrap(html)
|
5
|
+
"<!DOCTYPE html><html><body>#{html}</body></html>"
|
6
|
+
end
|
7
|
+
|
8
|
+
# Return the last error message on STDERR.
|
9
|
+
# Prevents the message being output to STDERR.
|
10
|
+
def last_stderr
|
11
|
+
orig_stderr = $stderr
|
12
|
+
$stderr = StringIO.new
|
13
|
+
yield
|
14
|
+
$stderr.rewind
|
15
|
+
message = $stderr.string.chomp
|
16
|
+
$stderr = orig_stderr
|
17
|
+
message
|
18
|
+
end
|