Skip to content

Commit

Permalink
built index for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
straleyb committed Oct 9, 2018
1 parent 36089d1 commit 09c1f06
Show file tree
Hide file tree
Showing 84 changed files with 34,446 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ gem 'triplestore-adapter', :github => "osulp/triplestore-adapter", :branch => "0
gem 'json-ld', '~> 1.99'

gem 'warden-github-rails'
gem 'rugged'
#gem 'rugged'

gem 'config'
gem 'simple_form'
Expand Down
2 changes: 0 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,6 @@ GEM
rspec-mocks (~> 3.5.0)
rspec-support (~> 3.5.0)
rspec-support (3.5.0)
rugged (0.25.1.1)
safe_yaml (1.0.4)
sass (3.2.19)
sass-rails (4.0.5)
Expand Down Expand Up @@ -493,7 +492,6 @@ DEPENDENCIES
responders (~> 2.0)
rest-client
rspec-rails
rugged
sass-rails (~> 4.0.3)
sdoc (~> 0.4.0)
shoulda-matchers
Expand Down
11 changes: 8 additions & 3 deletions build_index.js → lib/build_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,14 @@ stdin.on('end', function () {
var documents = JSON.parse(buffer.join(''))

var idx = lunr(function () {
this.ref('id')
this.field('title')
this.field('body')
this.ref('@id')
this.field('dc:title')
this.field('dc:date')
this.field('@type')
this.field('rdfs:label')
this.field('rdfs:comment')
this.field('dc:publisher')
this.field('schema:alternateName')

documents.forEach(function (doc) {
this.add(doc)
Expand Down
1 change: 1 addition & 0 deletions lib/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"2.3.3","fields":["dc:title","dc:date","@type","rdfs:label","rdfs:comment","dc:publisher","schema:alternateName"],"fieldVectors":[["dc:title/http://opaquenamespace.org/ns/TestVocabulary",[0,0.595]],["dc:date/http://opaquenamespace.org/ns/TestVocabulary",[]],["@type/http://opaquenamespace.org/ns/TestVocabulary",[1,1.337,2,1.337,3,0.299]],["rdfs:label/http://opaquenamespace.org/ns/TestVocabulary",[4,0.349]],["rdfs:comment/http://opaquenamespace.org/ns/TestVocabulary",[4,0.266]],["dc:publisher/http://opaquenamespace.org/ns/TestVocabulary",[4,0.136]],["schema:alternateName/http://opaquenamespace.org/ns/TestVocabulary",[4,0.215]],["dc:title/http://opaquenamespace.org/ns/TestVocabulary/TestTerm",[]],["dc:date/http://opaquenamespace.org/ns/TestVocabulary/TestTerm",[]],["@type/http://opaquenamespace.org/ns/TestVocabulary/TestTerm",[3,0.363,5,0.558]],["rdfs:label/http://opaquenamespace.org/ns/TestVocabulary/TestTerm",[4,0.349]],["rdfs:comment/http://opaquenamespace.org/ns/TestVocabulary/TestTerm",[4,0.266]],["dc:publisher/http://opaquenamespace.org/ns/TestVocabulary/TestTerm",[]],["schema:alternateName/http://opaquenamespace.org/ns/TestVocabulary/TestTerm",[]],["dc:title/http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",[]],["dc:date/http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",[6,0.485]],["@type/http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",[3,0.363,5,0.558]],["rdfs:label/http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",[0,1.528]],["rdfs:comment/http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",[4,0.266]],["dc:publisher/http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",[]],["schema:alternateName/http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",[4,0.215]],["dc:title/http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",[]],["dc:date/http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",[]],["@type/http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",[7,2.064]],["rdfs:label/http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",[]],["rdfs:comment/http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",[]],["dc:publisher/http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",[]],["schema:alternateName/http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",[]],["dc:title/http://opaquenamespace.org/ns/TestVocabulary/gumj",[]],["dc:date/http://opaquenamespace.org/ns/TestVocabulary/gumj",[]],["@type/http://opaquenamespace.org/ns/TestVocabulary/gumj",[3,0.363,5,0.558]],["rdfs:label/http://opaquenamespace.org/ns/TestVocabulary/gumj",[4,0.349]],["rdfs:comment/http://opaquenamespace.org/ns/TestVocabulary/gumj",[]],["dc:publisher/http://opaquenamespace.org/ns/TestVocabulary/gumj",[]],["schema:alternateName/http://opaquenamespace.org/ns/TestVocabulary/gumj",[]],["dc:title/http://opaquenamespace.org/ns/TestVocabulary/gumk",[]],["dc:date/http://opaquenamespace.org/ns/TestVocabulary/gumk",[]],["@type/http://opaquenamespace.org/ns/TestVocabulary/gumk",[3,0.363,8,1.623]],["rdfs:label/http://opaquenamespace.org/ns/TestVocabulary/gumk",[4,0.349]],["rdfs:comment/http://opaquenamespace.org/ns/TestVocabulary/gumk",[]],["dc:publisher/http://opaquenamespace.org/ns/TestVocabulary/gumk",[]],["schema:alternateName/http://opaquenamespace.org/ns/TestVocabulary/gumk",[]],["dc:title/http://opaquenamespace.org/ns/TestVocabulary/���",[]],["dc:date/http://opaquenamespace.org/ns/TestVocabulary/���",[]],["@type/http://opaquenamespace.org/ns/TestVocabulary/���",[5,0.709]],["rdfs:label/http://opaquenamespace.org/ns/TestVocabulary/���",[4,0.349]],["rdfs:comment/http://opaquenamespace.org/ns/TestVocabulary/���",[]],["dc:publisher/http://opaquenamespace.org/ns/TestVocabulary/���",[]],["schema:alternateName/http://opaquenamespace.org/ns/TestVocabulary/���",[]]],"invertedIndex":[["http://purl.org/dc/dcam/vocabularyencodingschem",{"_index":1,"dc:title":{},"dc:date":{},"@type":{"http://opaquenamespace.org/ns/TestVocabulary":{}},"rdfs:label":{},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}],["object",{"_index":4,"dc:title":{},"dc:date":{},"@type":{},"rdfs:label":{"http://opaquenamespace.org/ns/TestVocabulary":{},"http://opaquenamespace.org/ns/TestVocabulary/TestTerm":{},"http://opaquenamespace.org/ns/TestVocabulary/gumj":{},"http://opaquenamespace.org/ns/TestVocabulary/gumk":{},"http://opaquenamespace.org/ns/TestVocabulary/���":{}},"rdfs:comment":{"http://opaquenamespace.org/ns/TestVocabulary":{},"http://opaquenamespace.org/ns/TestVocabulary/TestTerm":{},"http://opaquenamespace.org/ns/TestVocabulary/TestTerm2":{}},"dc:publisher":{"http://opaquenamespace.org/ns/TestVocabulary":{}},"schema:alternateName":{"http://opaquenamespace.org/ns/TestVocabulary":{},"http://opaquenamespace.org/ns/TestVocabulary/TestTerm2":{}}}],["object object",{"_index":0,"dc:title":{"http://opaquenamespace.org/ns/TestVocabulary":{}},"dc:date":{},"@type":{},"rdfs:label":{"http://opaquenamespace.org/ns/TestVocabulary/TestTerm2":{}},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}],["rdf:properti",{"_index":2,"dc:title":{},"dc:date":{},"@type":{"http://opaquenamespace.org/ns/TestVocabulary":{}},"rdfs:label":{},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}],["rdfs:resourc",{"_index":3,"dc:title":{},"dc:date":{},"@type":{"http://opaquenamespace.org/ns/TestVocabulary":{},"http://opaquenamespace.org/ns/TestVocabulary/TestTerm":{},"http://opaquenamespace.org/ns/TestVocabulary/TestTerm2":{},"http://opaquenamespace.org/ns/TestVocabulary/gumj":{},"http://opaquenamespace.org/ns/TestVocabulary/gumk":{}},"rdfs:label":{},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}],["skos:concept",{"_index":5,"dc:title":{},"dc:date":{},"@type":{"http://opaquenamespace.org/ns/TestVocabulary/TestTerm":{},"http://opaquenamespace.org/ns/TestVocabulary/TestTerm2":{},"http://opaquenamespace.org/ns/TestVocabulary/gumj":{},"http://opaquenamespace.org/ns/TestVocabulary/���":{}},"rdfs:label":{},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}],["skos:geograph",{"_index":7,"dc:title":{},"dc:date":{},"@type":{"http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary":{}},"rdfs:label":{},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}],["skos:personalnam",{"_index":8,"dc:title":{},"dc:date":{},"@type":{"http://opaquenamespace.org/ns/TestVocabulary/gumk":{}},"rdfs:label":{},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}],["today",{"_index":6,"dc:title":{},"dc:date":{"http://opaquenamespace.org/ns/TestVocabulary/TestTerm2":{}},"@type":{},"rdfs:label":{},"rdfs:comment":{},"dc:publisher":{},"schema:alternateName":{}}]],"pipeline":["stemmer"]}
175 changes: 175 additions & 0 deletions lib/json-ld.dump
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
{
"@context": {
"dc": "http://purl.org/dc/terms/",
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
"schema": "http://schema.org/",
"skos": "http://www.w3.org/2004/02/skos/core#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary",
"@type": [
"http://purl.org/dc/dcam/VocabularyEncodingScheme",
"rdf:Property",
"rdfs:Resource"
],
"dc:issued": "2016-03-04",
"dc:modified": {
"@value": "2017-01-26",
"@type": "xsd:date"
},
"dc:publisher": {
"@value": "Me",
"@language": "ne"
},
"dc:title": [
{
"@value": "Testing Vocabulary",
"@language": "en"
},
{
"@value": "Testing Vocabulary Zulu",
"@language": "zu"
}
],
"rdfs:comment": {
"@value": "Simple comment",
"@language": "ja"
},
"rdfs:isDefinedBy": "Blahblah",
"rdfs:label": {
"@value": "Here is a sample label",
"@language": "an"
},
"rdfs:seeAlso": "Blahblah",
"rdfs:subPropertyOf": [
"asdf",
"{:scheme=>\"http\", :authority=>\"opaquenamespace.org\", :userinfo=>nil, :user=>nil, :password=>nil, :host=>\"opaquenamespace.org\", :port=>nil, :path=>\"/ns/TestVocabulary\", :query=>nil, :fragment=>nil}",
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary"
}
],
"schema:alternateName": {
"@value": "asdf",
"@language": "en"
}
},
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary/TestTerm",
"@type": [
"skos:Concept",
"rdfs:Resource"
],
"dc:issued": "2016-03-04",
"dc:modified": {
"@value": "2017-01-26",
"@type": "xsd:date"
},
"rdfs:comment": {
"@value": "Testing 1 2",
"@language": "th"
},
"rdfs:isDefinedBy": "yup",
"rdfs:label": {
"@value": "hello",
"@language": "fo"
},
"rdfs:seeAlso": "yup"
},
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary/TestTerm2",
"@type": [
"skos:Concept",
"rdfs:Resource"
],
"dc:date": "Today",
"dc:issued": "2016-03-04",
"dc:modified": {
"@value": "2018-10-09",
"@type": "xsd:date"
},
"rdfs:comment": {
"@value": "Comment",
"@language": "en"
},
"rdfs:isDefinedBy": "Comment",
"rdfs:label": [
{
"@value": "Blah2",
"@language": "de"
},
{
"@value": "Blah",
"@language": "en"
}
],
"rdfs:seeAlso": "Comment",
"schema:alternateName": {
"@value": "Alt Name",
"@language": "en"
}
},
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary/ValleyLibrary",
"@type": "skos:Geographic",
"dc:issued": {
"@value": "2016-08-30",
"@type": "xsd:date"
},
"dc:modified": {
"@value": "2016-08-30",
"@type": "xsd:date"
}
},
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary/gumj",
"@type": [
"skos:Concept",
"rdfs:Resource"
],
"dc:issued": "2016-04-07",
"dc:modified": {
"@value": "2016-11-04",
"@type": "xsd:date"
},
"rdfs:label": {
"@value": "Gum, Josh",
"@language": "en"
}
},
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary/gumk",
"@type": [
"skos:PersonalName",
"rdfs:Resource"
],
"dc:issued": "2016-11-04",
"dc:modified": {
"@value": "2016-11-04",
"@type": "xsd:date"
},
"rdfs:label": {
"@value": "Fictitious name",
"@language": "en"
}
},
{
"@id": "http://opaquenamespace.org/ns/TestVocabulary/���",
"@type": "skos:Concept",
"dc:issued": {
"@value": "2016-04-12",
"@type": "xsd:date"
},
"dc:modified": {
"@value": "2016-04-12",
"@type": "xsd:date"
},
"rdfs:label": {
"@value": "a testy",
"@language": "en"
}
}
]
}
9 changes: 9 additions & 0 deletions lib/jsonld_to_json.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
require "json"

file_contents = File.read('json-ld.dump')

parsed_json = JSON.parse(file_contents)

values = parsed_json["@graph"]

puts JSON.generate(values)
86 changes: 86 additions & 0 deletions lib/node_modules/lunr/.eslintrc.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions lib/node_modules/lunr/.npmignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions lib/node_modules/lunr/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 09c1f06

Please sign in to comment.