VIVO Documentation
Page History
...
The search page can be customized in terms of filters and sort options. For the purpose of customizing search page an ontology has been defined. . How the default configuration looks like can be seen at Using Search.
Ontology
The ontology is presented below.
Code Block |
---|
@prefix ocrerowl: <http://purlwww.w3.org/net2002/OCRe07/research.owl#> . @prefix prxsd: <https<http://iphwww.rasw3.ruorg/2001/relationships#>XMLSchema#> . @prefix owlrdfs: <http://www.w3.org/20022000/0701/owl#>rdf-schema#> . @prefix nssearch: <http<https://wwwvivoweb.w3.org/2003ontology/06/sw-vocab-status/ns#>vitro-search#> . @prefix sciresvitro: <http://vivoweb.org/ontology/scientific-research#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix skos: <http://www.w3.org/2004/02/skos/core#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix swo: <http://www.ebi.ac.uk/efo/swo/> . @prefix ocresd: <http://purl.org/net/OCRe/study_design.owl#> . @prefix cito: <http://purl.org/spar/cito/> . @prefix geo: <http://aims.fao.org/aos/geopolitical.owl#> . @prefix search: <https://vivoweb.org/ontology/vitro-search#> . @prefix ocresst: <http://purl.org/net/OCRe/statistics.owl#> . @prefix xml: <http://www.w3.org/XML/1998/namespace> . @prefix dcterms: <http://purl.org/dc/terms/> . @prefix vivo: <http://vivoweb.org/ontology/core#> . @prefix vann: <http://purl.org/vocab/vann/> . @prefix event: <http://purl.org/NET/c4dm/event.owl#> . @prefix foaf: <http://xmlns.com/foaf/0.1/> . @prefix c4o: <http://purl.org/spar/c4o/> . @prefix fabio: <http://purl.org/spar/fabio/> . @prefix vcard: <http://www.w3.org/2006/vcard/ns#> . @prefix vitro: <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> . @prefix skos2: <http://www.w3.org/2008/05/skos#> . @prefix vitro-public: <http://vitro.mannlib.cornell.edu/ns/vitro/public#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix ocresp: <http://purl.org/net/OCRe/study_protocol.owl#> . @prefix ecrm: <http://erlangen-crm.org/170309/> . @prefix bibo: <http://purl.org/ontology/bibo/> . @prefix ro: <http://purl.obolibrary.org/obo/ro.owl#> . @prefix obo: <http://purl.obolibrary.org/obo/> . @prefix dc: <http://purl.org/dc/elements/1.1/> . <https://vivoweb.org/ontology/vitro-search> avitro.mannlib.cornell.edu/ns/vitro/0.7#> . <https://vivoweb.org/ontology/vitro-search> a owl:Ontology ; vitro:ontologyPrefixAnnot "search" . search:PublicParameter a owl:Class . search:SearchField a owl:Class . search:FilterValue a owl:Class ; rdfs:subClassOf search:PublicParameter . search:Sort a owl:Class ; rdfs:subClassOf search:PublicParameter . search:RangeFilter a owl:Class ; rdfs:subClassOf owl:Ontology ; vitro:ontologyPrefixAnnot "search"search:Filter . search:PublicParameterFilterGroup a owl:Class .; search:SearchField a rdfs:subClassOf owl:Class search:PublicParameter . search:FilterValueFilter a owl:Class ; rdfs:subClassOf search:PublicParameter . search:Sortmultivalued a owl:DatatypeProperty , owl:ClassFunctionalProperty ; rdfs:subClassOfdomain search:PublicParameterSearchField .; search:RangeFilter a rdfs:range owl:Class ; rdfs:subClassOfxsd:boolean . search:isAscending a search:Filter . search:FilterGroup a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain owlsearch:ClassSort ; rdfs:subClassOfrange searchxsd:PublicParameterboolean . search:FilterindexField a owl:DatatypeProperty , owl:ClassFunctionalProperty ; rdfs:subClassOfdomain search:PublicParameterSearchField .; search:multivalued a rdfs:range owl:DatatypeProperty , xsd:string . search:contains a owl:FunctionalPropertyObjectProperty ; rdfs:domain search:SearchFieldFilterGroup ; rdfs:range xsdsearch:booleanFilter . search:isAscendingstep a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:SortRangeFilter ; rdfs:range xsd:booleanint . search:indexFieldisLanguageSpecific a a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:SearchField ; rdfs:range xsd:stringboolean . search:containsfilterField a owl:ObjectProperty , owl:ObjectPropertyFunctionalProperty ; rdfs:domain search:FilterGroupFilter ; rdfs:range search:FilterSearchField . search:stepisUriValues a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:RangeFilterFilter ; rdfs:range xsd:intboolean . search:isLanguageSpecific order a owl:DatatypePropertyFunctionalProperty , owl:FunctionalPropertyDatatypeProperty ; rdfs:domain search:SearchFieldPublicParameter ; rdfs:range xsd:booleaninteger . search:filterFielduserInput a owl:ObjectPropertyDatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:Filter ; rdfs:range searchxsd:SearchFieldboolean . search:isUriValuesfrom a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:FilterRangeFilter ; rdfs:range xsd:booleanstring . search:orderuserInputRegex a owl:FunctionalPropertyDatatypeProperty , owl:DatatypePropertyFunctionalProperty ; rdfs:domain search:PublicParameterFilter ; rdfs:range xsd:integerboolean . search:userInputsortField a owl:DatatypePropertyFunctionalProperty , owl:FunctionalPropertyObjectProperty ; rdfs:domain search:FilterSort ; rdfs:range xsdsearch:booleanSearchField . search:fromhasFallback a owl:DatatypePropertyFunctionalProperty , owl:FunctionalPropertyObjectProperty ; rdfs:domain search:RangeFilterSort ; rdfs:range xsdsearch:stringSort . search:userInputRegex id a a owl:DatatypeProperty , owl:FunctionalProperty ; owl:DatatypeProperty , owl:FunctionalProperty rdfs:domain search:PublicParameter ; rdfs:domainrange search:Filter ; rdfs:range xsd:boolean . search:sortFieldxsd:string . search:facetResults a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:Filter ; rdfs:range xsd:boolean . search:to a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:RangeFilter ; rdfs:range xsd:string . search:hasKnownValue a owl:ObjectProperty ; rdfs:domain search:Filter ; rdfs:range search:FilterValue . search:public a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:PublicParameter ; rdfs:range xsd:boolean . search:display a owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain search:Sort ; rdfs:range xsd:boolean . search:isDefaultForRole a owl:ObjectProperty ; rdfs:domain search:FilterValue ; rdfs:range auth:PermissionSet . search:moreLimit a owl:FunctionalProperty ; rdfs:domain search:Filter ; rdfs:range xsd:int ; rdfs:subPropertyOf owl:topDataProperty> . |
Filters
An example of configuration search page filters is provided below. It includes one filter group with four filters. The first filter is range filter and enables filtering by start and end date. The second and third filters enable filtering by organizations and persons, respectively. The last one is filter which enables selection of publication years. The first filter is not public, therefore it wouldn't be seen by visitors, i.e. not logged in users. The listed configuration is default one present in the VIVO codebase by default, and it can be customized for the specific need of a VIVO instance. Moreover, there are also a couple more filters defined in the Vitro codebase by default.
Code Block |
---|
@prefix : <https://vivoweb.org/ontology/vitro-search-individual/> .
@prefix vitro-search: <https://vivoweb.org/ontology/vitro-search#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:filter_group_search_filters a vitro-search:FilterGroup ;
vitro-search:contains :filter_dates , :filter_organizations , :filter_persons , :filter_publication_year .
:filter_dates a vitro-search:RangeFilter ;
vitro-search:id "dates" ;
vitro-search:filterField :field_dates ;
vitro-search:from "1900" ;
vitro-search:to "2030" ;
vitro-search:public false .
:field_dates a vitro-search:SearchField ;
vitro-search:indexField "dates_drsim" .
:filter_organizations a vitro-search:Filter ;
vitro-search:id "organizations" ;
vitro-search:filterField :field_organizations ;
vitro-search:facetResults true ;
vitro-search:isUriValues true ;
vitro-search:public true .
:field_organizations a vitro-search:SearchField ;
vitro-search:indexField "organizations_ss" ;
vitro-search:multivalued true .
:filter_persons a vitro-search:Filter ;
vitro-search:id "persons" ;
vitro-search:filterField :field_persons ;
vitro-search:facetResults true ;
vitro-search:isUriValues true ;
vitro-search:public true .
:field_persons a vitro-search:SearchField ;
vitro-search:indexField "persons_ss" ;
vitro-search:isLanguageSpecific true ;
vitro-search:multivalued true .
:filter_publication_year a vitro-search:Filter ;
vitro-search:id "publication_year" ;
vitro-search:filterField :field_publication_year ;
vitro-search:facetResults true ;
vitro-search:public true .
:field_publication_year a vitro-search:SearchField ;
vitro-search:indexField "publication_year_ss" .
|
Role based search filtering
Besides defining whether some field is public or not, the VIVO customers can define SelectQueryDocumentModifier for filters which can include typeRestrictions and selectQuery. In this way some restrictions for searching can be defined. Moreover, it is possible to define role-based search results filtering. For instance, it is possible that only a certain type of results can be displayed for a certain role. The listing below presents configuration which is showing only instances of Continent class for public, admin and self-editor.
Code Block |
---|
@prefix : <https://vivoweb.org/ontology/vitro-search-individual/> .
@prefix vitro-search: <https://vivoweb.org/ontology/vitro-search#> .
@prefix auth: <http://vitro.mannlib.cornell.edu/ns/vitro/authorization#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
:locations_value
a vitro-search:FilterValue ;
rdfs:label "Continent"@en-US ;
vitro-search:id "http://vivoweb.org/ontology/core#Continent" ;
vitro-search:public true ;
vitro-search:isDefaultForRole auth:SELF_EDITOR , auth:ADMIN , auth:PUBLIC .
:filter_type vitro-search:hasKnownValue :locations_value . |
Sorting
The options for sorting search results can be also customized. The default configuration enables sorting by title ascending, by title descending, and by relevance. However, it is possible to extend list of fields for sorting. For instance, sorting by dates can be added.
Code Block |
---|
@prefix : <https://vivoweb.org/ontology/vitro-search-individual/> . @prefix vitro-search: <https://vivoweb.org/ontology/vitro-search#> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . :sort_title_desc a owl:FunctionalProperty , owl:ObjectProperty ; rdfs:domainvitro-search:Sort ; vitro-search:isAscending false ; vitro-search:SorthasFallback :sort_name_raw_desc ; rdfsvitro-search:rangeorder 30 ; vitro-search:sortField search:SearchField . search:id a :field_label_sort ; vitro-search:display true ; vitro-search:id owl:DatatypeProperty , owl:FunctionalProperty ; rdfs:domain"titledesc" . :sort_title_asc a vitro-search:PublicParameterSort ; rdfsvitro-search:rangeisAscending true ; vitro-search:hasFallback xsd:string . search:facetResults a:sort_name_raw_asc ; vitro-search:order owl:DatatypeProperty , owl:FunctionalProperty 20 ; rdfsvitro-search:domainsortField :field_label_sort ; vitro-search:Filterdisplay ; true ; rdfs:range vitro-search:id xsd:boolean"titleasc" . search:to:sort_name_raw_desc a vitro-search:Sort ; owl:DatatypeProperty , owl:FunctionalPropertyvitro-search:isAscending false ; rdfsvitro-search:domainorder 50 ; vitro-search:RangeFiltersortField ; :field_name_raw ; rdfs:range vitro-search:id xsd:string "name_raw_desc" . search:hasKnownValue:sort_name_raw_asc a owlvitro-search:ObjectPropertySort ; rdfsvitro-search:domainisAscending true ; vitro-search:order search:Filter 40 ; rdfs:rangevitro-search:sortField :field_name_raw ; vitro-search:id search:FilterValue . search:public a"name_raw_asc" . :sort_by_relevance a vitro-search:Sort ; owl:DatatypeProperty , owl:FunctionalPropertyvitro-search:sortField :field_score ; rdfsvitro-search:domaindisplay true ; vitro-search:PublicParameterorder ; 60 rdfs:range; vitro-search:id xsd:boolean"relevance" . search:defaultPublicfield_score a <http://www.w3.org/2002/07/owl#DatatypeProperty> , <http://www.w3.org/2002/07/owl#FunctionalProperty> vitro-search:SearchField ; rdfsvitro-search:domainindexField <https://vivoweb.org/ontology/vitro-search#FilterValue> ;"score" . :field_label_sort rdfs:rangea <http://www.w3.org/2001/XMLSchema#boolean> ; rdfs:subPropertyOf <http://www.w3.org/2002/07/owl#topDataProperty> . search:moreLimit vitro-search:SearchField ; a vitro-search:isLanguageSpecific true ; <http://www.w3.org/2002/07/owl#DatatypeProperty> , <http://www.w3.org/2002/07/owl#FunctionalProperty> ; vitro-search:indexField "_label_sort" . :field_name_raw rdfs:domain <https://vivoweb.org/ontology/vitro-search#Filter> ; a rdfs:range <http://www.w3.org/2001/XMLSchema#int>vitro-search:SearchField ; rdfs:subPropertyOf <http://www.w3.org/2002/07/owl#topDataProperty> . |
Filters
Role based search filtering
...
vitro-search:indexField "nameRaw" .
|