Class: RDF::Microdata::Format
- Inherits:
-
Format
- Object
- Format
- RDF::Microdata::Format
- Defined in:
- lib/rdf/microdata/format.rb
Overview
Microdata format specification.
Class Method Summary (collapse)
-
+ (Boolean) detect(sample)
Sample detection to see if it matches Microdata (not RDF/XML or RDFa).
Class Method Details
+ (Boolean) detect(sample)
Sample detection to see if it matches Microdata (not RDF/XML or RDFa)
Use a text sample to detect the format of an input file. Sub-classes implement a matcher sufficient to detect probably format matches, including disambiguating between other similar formats.
30 31 32 |
# File 'lib/rdf/microdata/format.rb', line 30 def self.detect(sample) !!sample.match(/<[^>]*(itemprop|itemtype|itemref|itemscope|itemid)[^>]*>/m) end |