File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -102,6 +102,44 @@ foreach ($rdfProperty in $graphTypes['rdf:property']) {
102102$jsonSchema
103103
104104
105+ </Script >
106+ </ScriptMethod >
107+ <ScriptMethod >
108+ <Name >GetLexicon</Name >
109+ <Script >
110+
111+ param($graph = $this)
112+
113+ $jsonSchema = $this.GetJsonSchema($graph)
114+ if (-not $jsonSchema.'$id') {
115+ throw "Missing $jsonSchema.$id"
116+ return
117+ }
118+
119+ $domain, $relativePath = $jsonSchema.'$id' -replace '^$' -split '/'
120+ if (-not $domain) { return}
121+ if (-not $relativePath ) { return }
122+ $domain = @($domain -split '\.')
123+ [Array]::Reverse($domain)
124+ $nsid = $domain, $relativePath -join '.'
125+
126+
127+ $jsonSchema.psobject.properties.Remove('$id')
128+
129+ [Ordered]@{
130+ lexicon = 1
131+ id = $nsid
132+ defs = [Ordered]@{
133+ main = [Ordered]@{
134+ type = 'record'
135+ description = $jsonSchema.description
136+ record = $jsonSchema
137+ }
138+ }
139+ }
140+
141+
142+
105143 </Script >
106144 </ScriptMethod >
107145 </Members >
You can’t perform that action at this time.
0 commit comments