Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sanity Exhibition Nansen
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
uib-ub
Spesialsamlingene
Utstillinger
Sanity Exhibition Nansen
Commits
feba1b8e
Commit
feba1b8e
authored
3 years ago
by
Tarje.Lavik
Browse files
Options
Downloads
Patches
Plain Diff
Add @id mapping to classes
parent
a42dd4c4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
studio/plugins/jsonld-context/components/Context.js
+1
-1
1 addition, 1 deletion
studio/plugins/jsonld-context/components/Context.js
studio/plugins/jsonld-context/lib/index.js
+6
-4
6 additions, 4 deletions
studio/plugins/jsonld-context/lib/index.js
with
7 additions
and
5 deletions
studio/plugins/jsonld-context/components/Context.js
+
1
−
1
View file @
feba1b8e
...
...
@@ -10,7 +10,7 @@ const Context = ({ types }) => {
orderedClasses
.
forEach
((
type
)
=>
{
context
[
'
@context
'
][
type
.
name
]
=
{
'
@id
'
:
`
${
base
}${
type
.
name
}
`
,
'
@id
'
:
type
.
options
?.
jsonld
?.
context
?.[
'
@id
'
]
?
type
.
options
.
jsonld
.
context
?.[
'
@id
'
]
:
`
${
base
}${
type
.
name
}
`
,
'
@context
'
:
getFields
(
type
.
fields
,
base
),
};
});
...
...
This diff is collapsed.
Click to expand it.
studio/plugins/jsonld-context/lib/index.js
+
6
−
4
View file @
feba1b8e
...
...
@@ -5,8 +5,8 @@ import config from 'config:jsonld-context';
* Order the schemas for simpler diffs
*/
export
const
orderSchemas
=
(
schema
)
=>
{
const
orderedClasses
=
_
.
orderBy
(
schema
,
[
'
name
'
],
[
'
asc
'
]).
filter
(
_class
=>
_class
.
options
?.
jsonld
?.
exclude
!=
true
)
return
orderedClasses
const
result
=
_
.
orderBy
(
schema
,
[
'
name
'
],
[
'
asc
'
]).
filter
(
_class
=>
_class
.
options
?.
jsonld
?.
exclude
!=
true
)
return
result
}
/**
...
...
@@ -26,13 +26,15 @@ export const getContext = () => {
'
@context
'
:
{
'
@version
'
:
1.1
,
_id
:
'
@id
'
,
id
:
'
@id
'
,
_ref
:
'
@id
'
,
id
:
'
@id
'
,
_type
:
'
@type
'
,
type
:
'
@type
'
,
'
@base
'
:
config
.
base
?
config
.
base
:
undefined
,
[
vocab
]:
vocabUri
,
"
crm
"
:
"
http://www.cidoc-crm.org/cidoc-crm/
"
,
"
xsd
"
:
"
http://www.w3.org/2001/XMLSchema#
"
,
'
@base
'
:
config
.
base
?
config
.
base
:
undefined
"
rdfs
"
:
"
http://www.w3.org/2000/01/rdf-schema#
"
,
},
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment