bio-publisci 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/.travis.yml +13 -0
- data/Gemfile +24 -0
- data/LICENSE.txt +20 -0
- data/README.md +47 -0
- data/README.rdoc +48 -0
- data/Rakefile +70 -0
- data/bin/bio-publisci +83 -0
- data/features/create_generator.feature +25 -0
- data/features/integration.feature +12 -0
- data/features/integration_steps.rb +10 -0
- data/features/orm.feature +60 -0
- data/features/orm_steps.rb +74 -0
- data/features/reader.feature +25 -0
- data/features/reader_steps.rb +60 -0
- data/features/step_definitions/bio-publisci_steps.rb +0 -0
- data/features/store.feature +27 -0
- data/features/store_steps.rb +42 -0
- data/features/support/env.rb +13 -0
- data/features/writer.feature +9 -0
- data/features/writer_steps.rb +17 -0
- data/lib/bio-publisci/analyzer.rb +57 -0
- data/lib/bio-publisci/dataset/ORM/data_cube_orm.rb +219 -0
- data/lib/bio-publisci/dataset/ORM/observation.rb +20 -0
- data/lib/bio-publisci/dataset/data_cube.rb +308 -0
- data/lib/bio-publisci/dataset/interactive.rb +57 -0
- data/lib/bio-publisci/loader.rb +36 -0
- data/lib/bio-publisci/metadata/metadata.rb +105 -0
- data/lib/bio-publisci/parser.rb +64 -0
- data/lib/bio-publisci/query/query_helper.rb +114 -0
- data/lib/bio-publisci/r_client.rb +54 -0
- data/lib/bio-publisci/readers/arff.rb +87 -0
- data/lib/bio-publisci/readers/big_cross.rb +119 -0
- data/lib/bio-publisci/readers/cross.rb +72 -0
- data/lib/bio-publisci/readers/csv.rb +54 -0
- data/lib/bio-publisci/readers/dataframe.rb +66 -0
- data/lib/bio-publisci/readers/r_matrix.rb +152 -0
- data/lib/bio-publisci/store.rb +56 -0
- data/lib/bio-publisci/writers/arff.rb +66 -0
- data/lib/bio-publisci/writers/dataframe.rb +81 -0
- data/lib/bio-publisci.rb +36 -0
- data/lib/r2rdf.rb +226 -0
- data/lib/template_bak/publisci.rb +3 -0
- data/lib/template_bak.rb +12 -0
- data/lib/vocabs/cc.rb +18 -0
- data/lib/vocabs/cert.rb +13 -0
- data/lib/vocabs/dc.rb +63 -0
- data/lib/vocabs/dc11.rb +23 -0
- data/lib/vocabs/doap.rb +45 -0
- data/lib/vocabs/exif.rb +168 -0
- data/lib/vocabs/foaf.rb +69 -0
- data/lib/vocabs/geo.rb +13 -0
- data/lib/vocabs/http.rb +26 -0
- data/lib/vocabs/ma.rb +78 -0
- data/lib/vocabs/owl.rb +59 -0
- data/lib/vocabs/rdfs.rb +17 -0
- data/lib/vocabs/rsa.rb +12 -0
- data/lib/vocabs/rss.rb +14 -0
- data/lib/vocabs/sioc.rb +93 -0
- data/lib/vocabs/skos.rb +36 -0
- data/lib/vocabs/wot.rb +21 -0
- data/lib/vocabs/xhtml.rb +9 -0
- data/lib/vocabs/xsd.rb +58 -0
- data/resources/queries/codes.rq +13 -0
- data/resources/queries/dataset.rq +7 -0
- data/resources/queries/dimension_ranges.rq +8 -0
- data/resources/queries/dimensions.rq +7 -0
- data/resources/queries/measures.rq +7 -0
- data/resources/queries/observations.rq +12 -0
- data/resources/queries/test.rq +3 -0
- data/resources/weather.numeric.arff +23 -0
- data/spec/analyzer_spec.rb +36 -0
- data/spec/bio-publisci_spec.rb +7 -0
- data/spec/csv/bacon.csv +4 -0
- data/spec/csv/moar_bacon.csv +11 -0
- data/spec/data_cube_spec.rb +166 -0
- data/spec/generators/csv_spec.rb +44 -0
- data/spec/generators/dataframe_spec.rb +44 -0
- data/spec/generators/r_matrix_spec.rb +35 -0
- data/spec/queries/integrity/1.rq +21 -0
- data/spec/queries/integrity/11.rq +29 -0
- data/spec/queries/integrity/12.rq +37 -0
- data/spec/queries/integrity/14.rq +25 -0
- data/spec/queries/integrity/19_1.rq +21 -0
- data/spec/queries/integrity/19_2.rq +15 -0
- data/spec/queries/integrity/2.rq +22 -0
- data/spec/queries/integrity/3.rq +19 -0
- data/spec/queries/integrity/4.rq +13 -0
- data/spec/queries/integrity/5.rq +14 -0
- data/spec/r_builder_spec.rb +33 -0
- data/spec/spec_helper.rb +17 -0
- data/spec/turtle/bacon +149 -0
- data/spec/turtle/reference +2066 -0
- metadata +259 -0
data/lib/vocabs/ma.rb
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# W3C Media Annotation vocabulary.
|
4
|
+
# @see www.w3.org/ns/ma-ont.rdf
|
5
|
+
class MA < Vocabulary("http://www.w3.org/ns/ma-ont#")
|
6
|
+
property :IsRatingOf
|
7
|
+
property :alternativeTitle
|
8
|
+
property :averageBitRate
|
9
|
+
property :collectionName
|
10
|
+
property :copyright
|
11
|
+
property :createdIn
|
12
|
+
property :creationDate
|
13
|
+
property :date
|
14
|
+
property :depictsFictionalLocation
|
15
|
+
property :description
|
16
|
+
property :duration
|
17
|
+
property :editDate
|
18
|
+
property :features
|
19
|
+
property :fragmentName
|
20
|
+
property :frameHeight
|
21
|
+
property :frameRate
|
22
|
+
property :frameSizeUnit
|
23
|
+
property :frameWidth
|
24
|
+
property :hasAccessConditions
|
25
|
+
property :hasAudioDescription
|
26
|
+
property :hasCaptioning
|
27
|
+
property :hasChapter
|
28
|
+
property :hasClassification
|
29
|
+
property :hasClassificationSystem
|
30
|
+
property :hasCompression
|
31
|
+
property :hasContributor
|
32
|
+
property :hasCreator
|
33
|
+
property :hasFormat
|
34
|
+
property :hasFragment
|
35
|
+
property :hasGenre
|
36
|
+
property :hasKeyword
|
37
|
+
property :hasLanguage
|
38
|
+
property :hasLocationCoordinateSystem
|
39
|
+
property :hasNamedFragment
|
40
|
+
property :hasPermissions
|
41
|
+
property :hasPolicy
|
42
|
+
property :hasPublished
|
43
|
+
property :hasPublisher
|
44
|
+
property :hasRating
|
45
|
+
property :hasRatingSystem
|
46
|
+
property :hasRelatedImage
|
47
|
+
property :hasRelatedLocation
|
48
|
+
property :hasRelatedResource
|
49
|
+
property :hasSigning
|
50
|
+
property :hasSource
|
51
|
+
property :hasSubtitling
|
52
|
+
property :hasTargetAudience
|
53
|
+
property :hasTrack
|
54
|
+
property :isChapterOf
|
55
|
+
property :isCopyrightedBy
|
56
|
+
property :isLocationRelatedTo
|
57
|
+
property :isMemberOf
|
58
|
+
property :isProvidedBy
|
59
|
+
property :isRelatedTo
|
60
|
+
property :isSourceOf
|
61
|
+
property :isTargetAudienceOf
|
62
|
+
property :locationAltitude
|
63
|
+
property :locationLatitude
|
64
|
+
property :locationLongitude
|
65
|
+
property :locationName
|
66
|
+
property :locator
|
67
|
+
property :mainOriginalTitle
|
68
|
+
property :numberOfTracks
|
69
|
+
property :ratingScaleMax
|
70
|
+
property :ratingScaleMin
|
71
|
+
property :ratingValue
|
72
|
+
property :recordDate
|
73
|
+
property :releaseDate
|
74
|
+
property :samplingRate
|
75
|
+
property :title
|
76
|
+
property :trackName
|
77
|
+
end
|
78
|
+
end
|
data/lib/vocabs/owl.rb
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# Web Ontology Language (OWL) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://www.w3.org/TR/owl-overview/
|
6
|
+
class OWL < Vocabulary("http://www.w3.org/2002/07/owl#")
|
7
|
+
property :allValuesFrom
|
8
|
+
property :annotatedProperty
|
9
|
+
property :annotatedSource
|
10
|
+
property :annotatedTarget
|
11
|
+
property :assertionProperty
|
12
|
+
property :backwardCompatibleWith
|
13
|
+
property :bottomDataProperty
|
14
|
+
property :bottomObjectProperty
|
15
|
+
property :cardinality
|
16
|
+
property :complementOf
|
17
|
+
property :datatypeComplementOf
|
18
|
+
property :deprecated
|
19
|
+
property :differentFrom
|
20
|
+
property :disjointUnionOf
|
21
|
+
property :disjointWith
|
22
|
+
property :distinctMembers
|
23
|
+
property :equivalentClass
|
24
|
+
property :equivalentProperty
|
25
|
+
property :hasKey
|
26
|
+
property :hasSelf
|
27
|
+
property :hasValue
|
28
|
+
property :imports
|
29
|
+
property :incompatibleWith
|
30
|
+
property :intersectionOf
|
31
|
+
property :inverseOf
|
32
|
+
property :maxCardinality
|
33
|
+
property :maxQualifiedCardinality
|
34
|
+
property :members
|
35
|
+
property :minCardinality
|
36
|
+
property :minQualifiedCardinality
|
37
|
+
property :onClass
|
38
|
+
property :onDataRange
|
39
|
+
property :onDatatype
|
40
|
+
property :onProperties
|
41
|
+
property :onProperty
|
42
|
+
property :oneOf
|
43
|
+
property :priorVersion
|
44
|
+
property :propertyChainAxiom
|
45
|
+
property :propertyDisjointWith
|
46
|
+
property :qualifiedCardinality
|
47
|
+
property :sameAs
|
48
|
+
property :someValuesFrom
|
49
|
+
property :sourceIndividual
|
50
|
+
property :targetIndividual
|
51
|
+
property :targetValue
|
52
|
+
property :topDataProperty
|
53
|
+
property :topObjectProperty
|
54
|
+
property :unionOf
|
55
|
+
property :versionIRI
|
56
|
+
property :versionInfo
|
57
|
+
property :withRestrictions
|
58
|
+
end
|
59
|
+
end
|
data/lib/vocabs/rdfs.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# RDF Schema (RDFS) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://www.w3.org/TR/rdf-schema/
|
6
|
+
class RDFS < Vocabulary("http://www.w3.org/2000/01/rdf-schema#")
|
7
|
+
property :comment
|
8
|
+
property :domain
|
9
|
+
property :isDefinedBy
|
10
|
+
property :label
|
11
|
+
property :member
|
12
|
+
property :range
|
13
|
+
property :seeAlso
|
14
|
+
property :subClassOf
|
15
|
+
property :subPropertyOf
|
16
|
+
end
|
17
|
+
end
|
data/lib/vocabs/rsa.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# W3 RSA Keys (RSA) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://www.w3.org/ns/auth/rsa#
|
6
|
+
# @since 0.2.0
|
7
|
+
class RSA < Vocabulary("http://www.w3.org/ns/auth/rsa#")
|
8
|
+
property :modulus
|
9
|
+
property :private_exponent
|
10
|
+
property :public_exponent
|
11
|
+
end
|
12
|
+
end
|
data/lib/vocabs/rss.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# RDF Site Summary (RSS) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://web.resource.org/rss/1.0/
|
6
|
+
class RSS < Vocabulary("http://purl.org/rss/1.0/")
|
7
|
+
property :description
|
8
|
+
property :items
|
9
|
+
property :link
|
10
|
+
property :name
|
11
|
+
property :title
|
12
|
+
property :url
|
13
|
+
end
|
14
|
+
end
|
data/lib/vocabs/sioc.rb
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# Semantically-Interlinked Online Communities (SIOC) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://rdfs.org/sioc/spec/
|
6
|
+
class SIOC < Vocabulary("http://rdfs.org/sioc/ns#")
|
7
|
+
property :about
|
8
|
+
property :account_of
|
9
|
+
property :administrator_of
|
10
|
+
property :attachment
|
11
|
+
property :avatar
|
12
|
+
property :container_of
|
13
|
+
property :content
|
14
|
+
property :content_encoded # @deprecated
|
15
|
+
property :created_at # @deprecated
|
16
|
+
property :creator_of
|
17
|
+
property :description # @deprecated
|
18
|
+
property :earlier_version
|
19
|
+
property :email
|
20
|
+
property :email_sha1
|
21
|
+
property :feed
|
22
|
+
property :first_name # @deprecated
|
23
|
+
property :follows
|
24
|
+
property :function_of
|
25
|
+
property :group_of # @deprecated
|
26
|
+
property :has_administrator
|
27
|
+
property :has_container
|
28
|
+
property :has_creator
|
29
|
+
property :has_discussion
|
30
|
+
property :has_function
|
31
|
+
property :has_group # @deprecated
|
32
|
+
property :has_host
|
33
|
+
property :has_member
|
34
|
+
property :has_moderator
|
35
|
+
property :has_modifier
|
36
|
+
property :has_owner
|
37
|
+
property :has_parent
|
38
|
+
property :has_part # @deprecated
|
39
|
+
property :has_reply
|
40
|
+
property :has_scope
|
41
|
+
property :has_space
|
42
|
+
property :has_subscriber
|
43
|
+
property :has_usergroup
|
44
|
+
property :host_of
|
45
|
+
property :id
|
46
|
+
property :ip_address
|
47
|
+
property :last_activity_date
|
48
|
+
property :last_item_date
|
49
|
+
property :last_name # @deprecated
|
50
|
+
property :last_reply_date
|
51
|
+
property :later_version
|
52
|
+
property :latest_version
|
53
|
+
property :link
|
54
|
+
property :links_to
|
55
|
+
property :member_of
|
56
|
+
property :moderator_of
|
57
|
+
property :modified_at # @deprecated
|
58
|
+
property :modifier_of
|
59
|
+
property :name
|
60
|
+
property :next_by_date
|
61
|
+
property :next_version
|
62
|
+
property :note
|
63
|
+
property :num_authors
|
64
|
+
property :num_items
|
65
|
+
property :num_replies
|
66
|
+
property :num_threads
|
67
|
+
property :num_views
|
68
|
+
property :owner_of
|
69
|
+
property :parent_of
|
70
|
+
property :part_of # @deprecated
|
71
|
+
property :previous_by_date
|
72
|
+
property :previous_version
|
73
|
+
property :reference # @deprecated
|
74
|
+
property :related_to
|
75
|
+
property :reply_of
|
76
|
+
property :scope_of
|
77
|
+
property :sibling
|
78
|
+
property :space_of
|
79
|
+
property :subject # @deprecated
|
80
|
+
property :subscriber_of
|
81
|
+
property :title # @deprecated
|
82
|
+
property :topic
|
83
|
+
property :usergroup_of
|
84
|
+
|
85
|
+
##
|
86
|
+
# Semantically-Interlinked Online Communities (SIOC) types vocabulary.
|
87
|
+
#
|
88
|
+
# @see http://rdfs.org/sioc/spec/#sec-modules
|
89
|
+
class Types < RDF::Vocabulary("http://rdfs.org/sioc/types#")
|
90
|
+
# TODO
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
data/lib/vocabs/skos.rb
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# Simple Knowledge Organization System (SKOS) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://www.w3.org/TR/skos-reference/skos.html
|
6
|
+
class SKOS < Vocabulary("http://www.w3.org/2004/02/skos/core#")
|
7
|
+
property :altLabel
|
8
|
+
property :broadMatch
|
9
|
+
property :broader
|
10
|
+
property :broaderTransitive
|
11
|
+
property :changeNote
|
12
|
+
property :closeMatch
|
13
|
+
property :definition
|
14
|
+
property :editorialNote
|
15
|
+
property :exactMatch
|
16
|
+
property :example
|
17
|
+
property :hasTopConcept
|
18
|
+
property :hiddenLabel
|
19
|
+
property :historyNote
|
20
|
+
property :inScheme
|
21
|
+
property :mappingRelation
|
22
|
+
property :member
|
23
|
+
property :memberList
|
24
|
+
property :narrowMatch
|
25
|
+
property :narrower
|
26
|
+
property :narrowerTransitive
|
27
|
+
property :notation
|
28
|
+
property :note
|
29
|
+
property :prefLabel
|
30
|
+
property :related
|
31
|
+
property :relatedMatch
|
32
|
+
property :scopeNote
|
33
|
+
property :semanticRelation
|
34
|
+
property :topConceptOf
|
35
|
+
end
|
36
|
+
end
|
data/lib/vocabs/wot.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# Web of Trust (WOT) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://xmlns.com/wot/0.1/
|
6
|
+
class WOT < Vocabulary("http://xmlns.com/wot/0.1/")
|
7
|
+
property :assurance
|
8
|
+
property :encryptedTo
|
9
|
+
property :encrypter
|
10
|
+
property :fingerprint
|
11
|
+
property :hasKey
|
12
|
+
property :hex_id
|
13
|
+
property :identity
|
14
|
+
property :length
|
15
|
+
property :pubkeyAddress
|
16
|
+
property :sigdate
|
17
|
+
property :signed
|
18
|
+
property :signer
|
19
|
+
property :sigtime
|
20
|
+
end
|
21
|
+
end
|
data/lib/vocabs/xhtml.rb
ADDED
data/lib/vocabs/xsd.rb
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
module RDF
|
2
|
+
##
|
3
|
+
# XML Schema (XSD) vocabulary.
|
4
|
+
#
|
5
|
+
# @see http://www.w3.org/XML/Schema
|
6
|
+
# @see http://www.w3.org/TR/xmlschema-2/#built-in-datatypes
|
7
|
+
class XSD < Vocabulary("http://www.w3.org/2001/XMLSchema#")
|
8
|
+
# XML Schema built-in primitive types
|
9
|
+
# @see http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes
|
10
|
+
property :NOTATION
|
11
|
+
property :QName
|
12
|
+
property :anyURI
|
13
|
+
property :base64Binary
|
14
|
+
property :boolean
|
15
|
+
property :date
|
16
|
+
property :dateTime
|
17
|
+
property :decimal
|
18
|
+
property :double
|
19
|
+
property :duration
|
20
|
+
property :float
|
21
|
+
property :gDay
|
22
|
+
property :gMonth
|
23
|
+
property :gMonthDay
|
24
|
+
property :gYear
|
25
|
+
property :gYearMonth
|
26
|
+
property :hexBinary
|
27
|
+
property :string
|
28
|
+
property :time
|
29
|
+
|
30
|
+
# XML Schema built-in derived types
|
31
|
+
# @see http://www.w3.org/TR/xmlschema-2/#built-in-derived
|
32
|
+
property :ENTITIES
|
33
|
+
property :ENTITY
|
34
|
+
property :ID
|
35
|
+
property :IDREF
|
36
|
+
property :IDREFS
|
37
|
+
property :NCName
|
38
|
+
property :NMTOKEN
|
39
|
+
property :NMTOKENS
|
40
|
+
property :Name
|
41
|
+
property :byte
|
42
|
+
property :int
|
43
|
+
property :integer
|
44
|
+
property :language
|
45
|
+
property :long
|
46
|
+
property :negativeInteger
|
47
|
+
property :nonNegativeInteger
|
48
|
+
property :nonPositiveInteger
|
49
|
+
property :normalizedString
|
50
|
+
property :positiveInteger
|
51
|
+
property :short
|
52
|
+
property :token
|
53
|
+
property :unsignedByte
|
54
|
+
property :unsignedInt
|
55
|
+
property :unsignedLong
|
56
|
+
property :unsignedShort
|
57
|
+
end
|
58
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
PREFIX qb: <http://purl.org/linked-data/cube#>
|
2
|
+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
3
|
+
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
|
4
|
+
|
5
|
+
|
6
|
+
SELECT DISTINCT ?dimension ?code ?codeLabel WHERE{
|
7
|
+
?dim a qb:DimensionProperty;
|
8
|
+
rdfs:label ?dimension;
|
9
|
+
qb:codeList ?codes.
|
10
|
+
|
11
|
+
?codes skos:hasTopConcept ?code.
|
12
|
+
?code skos:prefLabel ?codeLabel.
|
13
|
+
}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
PREFIX qb: <http://purl.org/linked-data/cube#>
|
2
|
+
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
|
3
|
+
PREFIX prop: <http://www.rqtl.org/dc/properties/>
|
4
|
+
|
5
|
+
SELECT DISTINCT ?observation ?property ?value WHERE{
|
6
|
+
?observation a qb:Observation;
|
7
|
+
?property ?value.
|
8
|
+
|
9
|
+
{ ?property a qb:DimensionProperty. }
|
10
|
+
UNION
|
11
|
+
{ ?property a qb:MeasureProperty. }
|
12
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
@relation weather
|
2
|
+
|
3
|
+
@attribute outlook {sunny, overcast, rainy}
|
4
|
+
@attribute temperature real
|
5
|
+
@attribute humidity real
|
6
|
+
@attribute windy {TRUE, FALSE}
|
7
|
+
@attribute play {yes, no}
|
8
|
+
|
9
|
+
@data
|
10
|
+
sunny,85,85,FALSE,no
|
11
|
+
sunny,80,90,TRUE,no
|
12
|
+
overcast,83,86,FALSE,yes
|
13
|
+
rainy,70,96,FALSE,yes
|
14
|
+
rainy,68,80,FALSE,yes
|
15
|
+
rainy,65,70,TRUE,no
|
16
|
+
overcast,64,65,TRUE,yes
|
17
|
+
sunny,72,95,FALSE,no
|
18
|
+
sunny,69,70,FALSE,yes
|
19
|
+
rainy,75,80,FALSE,yes
|
20
|
+
sunny,75,70,TRUE,yes
|
21
|
+
overcast,72,90,TRUE,yes
|
22
|
+
overcast,81,75,FALSE,yes
|
23
|
+
rainy,71,91,TRUE,no
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require_relative '../lib/bio-publisci.rb'
|
2
|
+
|
3
|
+
describe R2RDF::Analyzer do
|
4
|
+
class Ana
|
5
|
+
include R2RDF::Analyzer
|
6
|
+
end
|
7
|
+
|
8
|
+
before(:all) do
|
9
|
+
@analyzer = Ana.new
|
10
|
+
|
11
|
+
@measures = ['chunkiness','deliciousness']
|
12
|
+
@dimensions = ['producer', 'pricerange']
|
13
|
+
@labels = %w(hormel newskies whys)
|
14
|
+
@data =
|
15
|
+
{
|
16
|
+
"producer" => ["hormel","newskies", "whys"],
|
17
|
+
"pricerange" => ["low", "medium", "nonexistant"],
|
18
|
+
"chunkiness"=> [1, 6, 9001],
|
19
|
+
"deliciousness"=> [1, 9, 6]
|
20
|
+
}
|
21
|
+
end
|
22
|
+
|
23
|
+
it "should run a basic validation" do
|
24
|
+
newdata = []
|
25
|
+
|
26
|
+
@data.keys.size.times{|i|
|
27
|
+
obs = {}
|
28
|
+
@data.map{|k,v|
|
29
|
+
obs[k] = v[i]
|
30
|
+
}
|
31
|
+
newdata << obs
|
32
|
+
}
|
33
|
+
|
34
|
+
@analyzer.check_integrity(newdata, @measures, @dimensions)
|
35
|
+
end
|
36
|
+
end
|
data/spec/csv/bacon.csv
ADDED