-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
80 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,60 @@ | ||
import { ConfigurationSchema } from '@jbrowse/core/configuration' | ||
import { types } from 'mobx-state-tree' | ||
|
||
import { OntologyRecordConfiguration } from './OntologyManager' | ||
export interface TextIndexFieldDefinition { | ||
/** name to display in the UI for text taken from this field or fields */ | ||
displayName: string | ||
/** JSONPath of the field(s) */ | ||
jsonPath: string | ||
} | ||
export const defaultTextIndexFields: TextIndexFieldDefinition[] = [ | ||
{ displayName: 'Label', jsonPath: '$.lbl' }, | ||
{ displayName: 'Synonym', jsonPath: '$.meta.synonyms[*].val' }, | ||
{ displayName: 'Definition', jsonPath: '$.meta.definition.val' }, | ||
] | ||
|
||
const ApolloPluginConfigurationSchema = ConfigurationSchema('ApolloPlugin', { | ||
ontologies: types.array(OntologyRecordConfiguration), | ||
}) | ||
export const OntologyRecordConfiguration = ConfigurationSchema( | ||
'OntologyRecord', | ||
{ | ||
name: { | ||
type: 'string', | ||
description: 'the full name of the ontology, e.g. "Gene Ontology"', | ||
defaultValue: 'My Ontology', | ||
}, | ||
version: { | ||
type: 'string', | ||
description: "the ontology's version string", | ||
defaultValue: 'unversioned', | ||
}, | ||
source: { | ||
type: 'fileLocation', | ||
description: "the download location for the ontology's source file", | ||
defaultValue: { | ||
locationType: 'UriLocation', | ||
uri: 'http://example.com/myontology.json', | ||
}, | ||
}, | ||
textIndexFields: { | ||
type: 'frozen', | ||
description: | ||
'JSON paths for text fields that will be indexed for text searching', | ||
defaultValue: defaultTextIndexFields, | ||
}, | ||
}, | ||
{ explicitlyTyped: true }, | ||
) | ||
|
||
const ApolloPluginConfigurationSchema = ConfigurationSchema( | ||
'ApolloPlugin', | ||
{ | ||
ontologies: types.array(OntologyRecordConfiguration), | ||
featureTypeOntologyName: { | ||
description: 'Name of the feature type ontology', | ||
type: 'string', | ||
defaultValue: 'Sequence Ontology', | ||
}, | ||
}, | ||
{ explicitlyTyped: true }, | ||
) | ||
|
||
export default ApolloPluginConfigurationSchema |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters