SOLR and the ORE ontology gem
AggregationResource
Properties
Property | Predicate | Type | Count | Comments |
---|---|---|---|---|
id | [ URI ] | 1 | rdf_subject | |
type | RDF::type | [ URI ] | 1..m | can a resource not have a type? |
title | RDF::DC.title | string | 1 | |
description | RDF::DC.description | string | 1 | |
owner | DCTERMS.creator | FOAF.person [ URI ] | 1..m | Likely moving to PROV-O or PRAV can there be multiple owners? |
aggregates | ORE.aggregates | [ URI ] | 0..m | |
first | IANA.first | ORE.proxy [ URI ] | 0..1 | |
last | IANA.last | ORE.proxy [ URI ] | 0..m |
Solr
Fields
field name | type | value | value from property | indexed (i) | stored (s) | multi (m) | required | facet | sortable |
---|---|---|---|---|---|---|---|---|---|
id | string | rdf_subject of ORE.Aggregation | obj.id | yes | yes | no | yes | no | |
at_model | string | "LD4L::OreRDF::AggregationResource" | obj.class.to_s | yes | yes | no | yes | yes | ? |
title_ti | text | "my","collection" | obj.title | yes | no | no | yes | no | no |
title_sort_ss | string | "My Collection" | obj.title | no | yes | no | yes | no | yes |
description_tsi | text | "my","collection","resources" | obj.description | yes | yes | no | yes | no | no |
owner_uri_ss | string | FOAF.person [ URI ] | obj.owner | no | yes | ? | yes | no | no |
owner_name_ti | text | "john","smith" | obj.owner.name | yes | no | ? | yes | yes | no |
owner_name_sort_ss | string | "John Smith" | obj.owner.name | no | yes | ? | yes | no | yes |
item_proxies_ssm | string | ORE.proxy [ URI ] - gathered from all proxies | generated | no | yes | yes | no | no | ? |
resources_ssim | string | [ URI ] | obj.aggregates | yes | yes | yes | no | no | ? |
object_profile_ss | string | "object_profile_ssm":[ "{ \"id\":\"http://www.example.org/a2d61b58-2207-49d4-b151-140def2b11c0\", | serialization of active_triples object | no | yes | ? | yes | no | no |
NOTE: All fields are dynamic except id and at_model.
Example Solr Document
{ "id":"http://www.example.org/a2d61b58-2207-49d4-b151-140def2b11c0", "at_model_ssi":"LD4L::OreRDF::AggregationResource", "title_sort_ss":"My Collection", "description_tsi":"My collection of resources.", "owner_uri_ss":"http://example.org/js333", "owner_name_sort_ss":"John Smith", "item_proxies_ssm": [ "http://www.example.org/75661b44-4524-1883-3653-483d34b11a534" "http://www.example.org/82361b44-2324-1943-8a53-493d34b11a1c4" "http://www.example.org/23161b44-9824-1323-8453-993d34b11a883" ], "object_profile_ssm":[ "{ \"id\":\"http://www.example.org/a2d61b58-2207-49d4-b151-140def2b11c0\", \"type\":\"http://www.openarchives.org/ore/terms/Aggregation\", \"title\":\"My Collection\", \"description\":\"My collection of resources.\", \"owner\":\"http://example.org/elr\", \"aggregates\":[{\"https://newcatalog.library.cornell.edu/catalog/5449293\"}], \"first_proxy\":\"http://www.example.org/75661b44-4524-1883-3653-483d34b11a534\", \"last_proxy\":\"http://www.example.org/23161b44-9824-1323-8453-993d34b11a883\" }" ] }
Queries
Get all collections owned by user.
http://localhost:8983/solr/#/development/select? q=owner_uri_ss:http://example.org/elr &fq=at_model_ssi:LD4L\:\:OreRDF\:\:AggregationResource &fl=id,object_profile_ssm
ProxyResource
Properties
Property | Predicate | Type | Count | Comments |
---|---|---|---|---|
id | [ URI ] | 1 | rdf_subject | |
type | RDF:type | [ URI ] | 1..m | can a resource not have a type? |
proxyFor | ORE.proxyFor | [ URI ] | 1 | resource uri |
proxyIn | ORE.proxyIn | ORE.Aggregation [ URI ] | 1 | aggregation uri |
next | IANA.next | ORE.proxy [ URI ] | 0..1 | uri of next proxy in the linked list |
prev | IANA.prev | ORE.proxy [ URI ] | 0..1 | uri of previous proxy in the linked list |
contributor | RDF::DC.contributor | FOAF.person [ URI ] | 0..m | Likely moving to PROV-O or PRAV |
Solr
Fields
field name | type | value | value from property | indexed (i) | stored (s) | multiValued (m) | required | facet | sortable |
---|---|---|---|---|---|---|---|---|---|
id | string | rdf_subject of ORE.Proxy | obj.id | yes | yes | no | yes | no | |
at_model_ssi | string | "LD4L::OreRDF::ProxyResource" | obj.class.to_s | yes | yes | no | yes | yes | ? |
proxy_in_ssi | string | [ URI ] of parent vc | obj.proxy_in | yes | no | no | yes | yes | no |
proxy_for_ssi | string | [ URI ] of resource in catalog | obj.proxy_for | yes | no | no | yes | yes | no |
prev_ss | string | [ URI ] | obj.prev | no | yes | no | no | no | no |
next_ss | string | [ URI ] | obj.next | no | yes | no | no | no | no |
contributor_uri_ss | string | [ URI ] | obj.contributor | no | yes | ? | yes | no | no |
contributor_name_ti | text | "john","smith" | obj.contributor.name | yes | no | ? | yes | yes | no |
contributor_name_sort_ss | string | "John Smith" | obj.contributor.name | no | yes | ? | yes | no | yes |
object_profile_ss | string | "object_profile_ssm":[ "{ \"id\":\"http://www.example.org/82361b44-2324-1943-8a53-493d34b11a1c4\", | serialization of active_triples object | no | yes | ? | yes | no | no |
order_itsi | tint | 0..N | generated | yes | yes | no | yes | no | yes |
resource_title_ti | text | "archery", "fundamentals" | get from content negotiation of obj.proxy_for | yes | no | ? | yes | yes | no |
resource_title_sort_ss | string | "Archery fundamentals" | get from content negotiation of obj.proxy_for | no | yes | ? | yes | no | yes |
resource_author_ti | text | ["douglas", "engh"] | get from content negotiation of obj.proxy_for | yes | no | yes | no | yes | no |
resource_author_sort_ss | string | ["Douglas Engh."] | get from content negotiation of obj.proxy_for | no | yes | yes | no | no | yes |
resource_subject_ti | text | ["archery","arrow","bow","games","history"] | get from content negotiation of obj.proxy_for | yes | no | yes | no | yes | no |
resource_subject_sort_ss | string | ["Archery","Bow and arrow","Games,History"] | get from content negotiation of obj.proxy_for | no | yes | yes | no | no | yes |
resource_call_number_ti | text | ["anthropology","geography","history","recreation","world"] | get from content negotiation of obj.proxy_for | yes | no | ? | no | yes | no |
resource_call_number_sort_ss | string | ["G - Geography, Anthropology, Recreation", "D - World History"] | get from content negotiation of obj.proxy_for | no | yes | ? | no | no | yes |
resource_publisher_ti | text | "champaign","il","human","kinetics","c2005" | get from content negotiation of obj.proxy_for | yes | no | ? | no | no | no |
resource_publisher_ss | string | "Champaign, IL : Human Kinetics, c2005." | get from content negotiation of obj.proxy_for | no | yes | ? | no | no | yes |
resource_publication_year_iti | tint | 2005 | get from content negotiation of obj.proxy_for | yes | no | ? | no | yes | no |
resource_profile_ss | string | "resource_profile_ssm":[ | serialization of resource metadata | no | yes | no | yes | no | no |
NOTE: All fields are dynamic except id and at_model.
Example Solr Document
{ "id":"http://www.example.org/82361b44-2324-1943-8a53-493d34b11a1c4", "at_model":"LD4L::OreRDF::ProxyResource", "proxy_in_ssi":"http://www.example.org/a2d61b58-2207-49d4-b151-140def2b11c0" "proxy_for_ssi":"https://newcatalog.library.cornell.edu/catalog/5449293" "prev_ss":"http://www.example.org/75661b44-4524-1883-3653-483d34b11a534", "next_ss":"http://www.example.org/23161b44-9824-1323-8453-993d34b11a883", "contributor_uri_ss":"http://example.org/js333", "contributor_name_sort_ss":"John Smith", "object_profile_ssm":[ "{ \"id\":\"http://www.example.org/82361b44-2324-1943-8a53-493d34b11a1c4\", \"type\":\"http://www.openarchives.org/ore/terms/Proxy\", \"proxy_in\":\"http://www.example.org/a2d61b58-2207-49d4-b151-140def2b11c0\" \"proxy_for\":\"https://newcatalog.library.cornell.edu/catalog/5449293\" \"prev\":\"http://www.example.org/75661b44-4524-1883-3653-483d34b11a534\" \"next\":\"http://www.example.org/23161b44-9824-1323-8453-993d34b11a883\" }" ], "order_itsi":2 "resource_title_sort_ss":"Archery fundamentals", "resource_author_sort_ss":["Douglas Engh."], "resource_subject_sort_ss":["Archery","Bow and arrow","Games,History"], "resource_call_number_sort_ss":["G - Geography, Anthropology, Recreation", "D - World History"], "resource_publisher_ss":"Champaign, IL : Human Kinetics, c2005." "resource_profile_ssm":[ "{ \"resource_title_sort_ss\":\"Archery fundamentals\", \"resource_author_sort_ss\":[\"Douglas Engh.\"], \"resource_subject_sort_ss\":[\"Archery\",\"Bow and arrow\",\"Games,History\"], \"resource_call_number_sort_ss\":[\"G - Geography, Anthropology, Recreation\", \"D - World History\"], \"resource_publisher_ss\":\"Champaign, IL : Human Kinetics, c2005.\" }" ] }
Queries
Get display fields for first 20 items in a virtual collection __VC_URI__.
# assumes contiguous ordering which has implications for reordering, inserts, deletes with potential updates to all proxies in the worst case http://localhost:8983/solr/#/development/select? q=proxy_in_ssi:__VC_URI__& &fq=at_model_ssi:LD4L\:\:OreRDF\:\:ProxyResource &fq=order_itsi:[0 TO 19] &fl=id,object_profile_ssm,resource_profile_ssm &sort=order # potential to skip documents with reodering, inserts, deletes by other users # has to get all documents before start + rows - has implications for getting start=1000000000 rows=20 http://localhost:8983/solr/#/development/select? q=proxy_in_ssi:__VC_URI__& &fq=at_model_ssi:LD4L\:\:OreRDF\:\:ProxyResource &fl=id,object_profile_ssm,resource_profile_ssm &sort=order &start=0 &rows=19
Find next 20 items for a virtual collection __VC_URI__.
http://localhost:8983/solr/#/development/select? q=proxy_in_ssi:__VC_URI__& &fq=at_model_ssi:LD4L\:\:OreRDF\:\:ProxyResource &fq=order_itsi:[20 TO 39] &fl=id,object_profile_ssm,resource_profile_ssm &sort=order http://localhost:8983/solr/#/development/select? q=proxy_in_ssi:__VC_URI__& &fq=at_model_ssi:LD4L\:\:OreRDF\:\:ProxyResource &fl=id,object_profile_ssm,resource_profile_ssm &sort=order &start=20 &rows=19