Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6373369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:21:21+00:00 2026-05-25T01:21:21+00:00

I’m mainly using Ruby to do this but my plan of attack thus far

  • 0

I’m mainly using Ruby to do this but my plan of attack thus far is as follows:

Use the gems rdf,rdf-rdfa, and either rdf-microdata or mida to parse data given any URI. I think it’d be best to map to a uniform schema like schema.org, for example take this yaml file which attempts to describe the conversion between data-vocabulary and opengraph to schema.org:

# Schema X to schema.org conversion
#data-vocabulary
DV:
  name:name
  street-address:streetAddress
  region:addressRegion
  locality:addressLocality
  photo:image
  country-name:addressCountry
  postal-code:postalCode
  tel:telephone
  latitude:latitude
      longitude:longitude
  type:type
#opengraph
OG:
  title:name
  type:type
  image:image
  site_name:site_name
  description:description
  latitude:latitude
  longitude:longitude
  street-address:streetAddress
  locality:addressLocality
  region:addressRegion
  postal-code:postalCode
  country-name:addressCountry
  phone_number:telephone
  email:email

I can then store information found in one format and re-display them with schema.org syntax.

The other part is determining type. I’d model my tables after schema.org and I’d like to know the type of ‘Thing’ (Thing) a record would be. So if I parse an opengraph type of ‘bar’, I’d store it is ‘BarOrPub’ (BarOrPub).

Is there a better way of doing this? Something automated? A solution already out there? Any input appreciated.

EDIT:

So I’m finding that this parses pretty well (where all_tags includes the tags i’m interested in as keys and schema.org equivalent as the value):

RDF::RDFa::Reader.open(url) do |reader|
        reader.each_statement do |statement|
          tag = statement.predicate.to_s.split('/')[-1].split('#')[-1]
          Rails.logger.debug "rdf tag: #{tag}"
          Rails.logger.debug "rdf predicate: #{statement.predicate}"
          if all_tags.keys.include? tag
            Rails.logger.debug "Found mapping for #{statement.predicate} and #{all_tags[tag]}"
            results[all_tags[tag]] = statement.object.to_s.strip
          end
        end
      end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:21:22+00:00Added an answer on May 25, 2026 at 1:21 am

    For the original question, you’re on the right track. In fact, we do similar things in the structured-data.org linter. It might be useful for you to check out the GitHub repo. The basic idea is to to format detection and choose the appropriate reader (RDFa, Microdata or whatever). Once read, you’ll have a graph. You’ll want to run through each statement in the graph and create a new output graph with predicates and types mapped based on your table. So, for instance, if you say dv:name as a predicate in the source graph, you could output schema:name in the output graph.

    Determining type will also require a mapping table to come up with the appropriate output type. Note that OGP doesn’t actually use rdf:type, so you’ll need to find a statement with ogp:type and output an rdf:type along with the mapped class.

    Another way to approach the whole thing would be to create an vocabulary with owl:equivalentProperty/equivalentClass assertions and perform OWL entailment to add appropriate triples to the original graph. Ruby’s toolset isn’t (yet) quite up to this at this point.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.