Module: When::Events

Defined in:
lib/when_exe/events.rb,
lib/when_exe.rb

Overview

時間座標を持つイベント記録の管理

Defined Under Namespace

Classes: DataSet, DataSets, Event, Range

Constant Summary collapse

TS =

When.exe Time Schema - TS may not equal When::Resource.base_uri.sub(/When/$/, ‘ts#’)

'http://hosi.org/ts#'
TT =

Time Schema

TS.sub(/#\z/,'/')
RANGE =
TT + Range.class.to_s.gsub('::','/')
ID =
TS + 'id'
IRI =
TS + 'IRI'
REFERENCE =
TS + 'reference'
GROUP =
TS + 'group'
WHAT_DAY =
TS + 'whatDay'
START =
TS + 'start'
UNTIL =
TS + 'until'
WEST =
TS + 'west'
EAST =
TS + 'east'
SOUTH =
TS + 'south'
NORTH =
TS + 'north'
BOTTOM =
TS + 'bottom'
TOP =
TS + 'top'
INTEGER =

XML Schema Definition

Namespace::XSD  + '#integer'
FLOAT =
Namespace::XSD  + '#float'
DOUBLE =
Namespace::XSD  + '#double'
STRING =
Namespace::XSD  + '#string'
DATE =
Namespace::XSD  + '#date'
TIME =
Namespace::XSD  + '#time'
DATETIME =
Namespace::XSD  + '#dateTime'
TYPE =

Resource Description Framework

Namespace::RDF  + 'type'
SUBJECT =
Namespace::RDF  + 'subject'
LABEL =
Namespace::RDFS + 'label'
GRAPH =
Namespace::RDFC + 'section-rdf-graph'
SOURCE =

Dublin Core

Namespace::DC   + 'source'
CONTRIBUTOR =
Namespace::DC   + 'contributor'
LICENSE =
Namespace::DCQ  + 'license'
VALID =
Namespace::DCQ  + 'valid'
ABSTRACT =
Namespace::DCQ  + 'abstract'
HAS_PART =
Namespace::DCQ  + 'hasPart'
SPATIAL =
Namespace::DCQ  + 'spatial'
URI =
Namespace::DCQ  + 'URI'
ForDataset =

For Dataset

[LABEL, REFERENCE, CONTRIBUTOR, LICENSE]
EqualIndex =

Index

[SUBJECT, GRAPH, GROUP, CONTRIBUTOR, SPATIAL]
FirstEdge =
{'valid'=>START, 'longitude'=>WEST, 'latitude'=>SOUTH, 'altitude'=>BOTTOM}
LastEdge =
{'valid'=>UNTIL, 'longitude'=>EAST, 'latitude'=>NORTH, 'altitude'=>TOP   }

Class Method Summary collapse

Class Method Details

.cardinality1(predicate) ⇒ Boolean

出現回数の限定

Parameters:

  • predicate (String)

    述語

Returns:

  • (Boolean)

    true 1回限定, false 限定なし



536
537
538
# File 'lib/when_exe/events.rb', line 536

def self.cardinality1(predicate)
  predicate != HAS_PART
end

.edge(predicate) ⇒ Symbol

境界インデクスの判断

Parameters:

  • predicate (String)

    述語

Returns:

  • (Symbol)

    :first 下限境界, :last 上限境界, nil どちらでもなし



522
523
524
525
526
527
528
# File 'lib/when_exe/events.rb', line 522

def self.edge(predicate)
  FirstEdge.values.include?(predicate) ?
    :first :
  LastEdge.values.include?(predicate) ?
    :last  :
    nil
end

.equal(predicate) ⇒ Symbol

同値インデクスの判断

Parameters:

  • predicate (String)

    述語

Returns:

  • (Symbol)

    :equal 作成する, nil 作成しない



510
511
512
513
514
# File 'lib/when_exe/events.rb', line 510

def self.equal(predicate)
  EqualIndex.include?(predicate) ?
    :equal :
    nil
end