Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
feat(proposals): add sameAs support
Browse files Browse the repository at this point in the history
  • Loading branch information
vhf committed Oct 28, 2019
1 parent 7d24818 commit 238e475
Show file tree
Hide file tree
Showing 7 changed files with 322 additions and 154 deletions.
33 changes: 33 additions & 0 deletions components/fallback/ObjectDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,32 @@
</li>
</ul>
</section>
<section
class="content"
v-show="sameAs.length">
<h4 class="title is-2">
Same As
</h4>
<p class="title-url is-size-7">
http://www.w3.org/2002/07/owl#equivalentProperty
</p>
<ul class="types-list">
<li
v-for="sameAsIRI in sameAs"
:key="sameAsIRI">
<a
v-if="$unPrefix(sameAsIRI)"
:href="$rebaseIRI(sameAsIRI)">
{{ $unPrefix(sameAsIRI) }}
</a>
<a
v-else
:href="$rebaseIRI(sameAsIRI)">
{{ sameAsIRI }}
</a>
</li>
</ul>
</section>
</template>
<section
v-show="examples.length"
Expand Down Expand Up @@ -204,6 +230,13 @@ export default {
const classes = this.$rangeOf(this.iri.value, this.ontology)
return classes
},
sameAs () {
const sameAs = this.ontology.match(this.iri, this.$termIRI.sameAs)
.toArray()
.map((quad) => _get(quad.object, 'value'), '')
.filter(Boolean)
return sameAs
},
examples () {
return this.ontology.match(this.iri, this.$termIRI.example)
.toArray()
Expand Down
46 changes: 5 additions & 41 deletions components/proposal/ClassForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,39 +9,6 @@
}">

<template v-if="disabled || !clss['isSubFormCollapsed']">
<!--
<div
v-show="!subform && clss['iri']"
class="box debug">
<div class="columns">
<div class="column">
<button
class="button is-big is-warning"
@click.prevent="debugGenerateNT">
debug button: refresh NT
</button>
</div>
</div>
<div class="columns">
<div class="column">
<pre
class="is-clearfix"
v-show="debugNT">{{ debugNT }}</pre>
</div>
</div>
<div
v-show="debugNT"
class="columns">
<div class="column">
<button
class="button is-big is-warning"
@click.prevent="debugGenerateNT">
debug button: refresh NT
</button>
</div>
</div>
</div>
-->

<div
:class="{
Expand All @@ -68,9 +35,9 @@
<span class="title-url">{{ clss['iri'] }}</span>
</p>
</div>
<!--<div class="column">
<button class="button is-warning is-pulled-right">Remove</button>
</div>-->
<div class="column">
<!-- <button class="button is-warning is-pulled-right">Remove</button> -->
</div>
</div>

<div class="columns class-details">
Expand Down Expand Up @@ -162,8 +129,7 @@
v-show="validBase"
class="columns fold">
<div class="column">
<div
v-if="renderTypeahead">
<no-ssr>
<typeahead
:disabled="disabled"
:search-function="searchFunction"
Expand All @@ -182,8 +148,7 @@
</a>
</div>
</typeahead>
</div>
<div v-else />
</no-ssr>
</div>
<div class="column" />
</div>
Expand Down Expand Up @@ -318,7 +283,6 @@ export default {
data () {
return {
searchFunction: () => ([]),
renderTypeahead: process.client,
ontology: rdf.dataset(),
structure: rdf.dataset(),
debugNT: ''
Expand Down
2 changes: 1 addition & 1 deletion components/proposal/ProgressionBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default {
if (this.edit) {
return ''
}
if (this.obj.isEdit) {
if (this.obj && this.obj.isEdit) {
return 'Changed '
}
return 'New '
Expand Down
Loading

0 comments on commit 238e475

Please sign in to comment.