Class: YARSPG::Format
- Inherits:
-
RDF::Format
- Object
- RDF::Format
- YARSPG::Format
- Defined in:
- lib/yarspg/format.rb
Overview
YARS-PG format specification.
Class Method Summary collapse
-
.detect(sample) ⇒ Boolean
Sample detection to see if it matches YARS-PG.
Class Method Details
.detect(sample) ⇒ Boolean
Sample detection to see if it matches YARS-PG
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.
33 34 35 36 37 38 39 40 |
# File 'lib/yarspg/format.rb', line 33 def self.detect(sample) !!sample.match(%r( (?:%(METADATA|NODE SCHEMAS|EDGE SCHEMAS|NODES|EDGES)) | # Section Names (?:[S\{.*\}]-) | # Node Schema (?:[S\(.*\)]-) | # Edge Schema (?:\(.*\)-) # Edge )mx) end |