update to model utils to replace Capital letter with lowercase for one of the relationships, updates to concept generator to enable deletion of relationship on remove and not concept individual itself, also including addition of inverse property as well, also updating grant role generator to identify correct inverse predicate and not 'relatedRole' as it had been
This commit is contained in:
parent
6872af6545
commit
acc7dfcfda
6 changed files with 45 additions and 14 deletions
|
@ -279,12 +279,13 @@ var addConceptForm = {
|
|||
if ($(link)[0] === $('.remove:last')[0]) {
|
||||
removeLast = true;
|
||||
}
|
||||
|
||||
//Using primitive rdf edit which expects an n3 string for deletion
|
||||
$.ajax({
|
||||
url: $(link).attr('href'),
|
||||
type: 'POST',
|
||||
data: {
|
||||
deletion: $(link).parents('.existingConcept').data('conceptNodeUri')
|
||||
additions: '',
|
||||
retractions: addConceptForm.generateDeletionN3($(link).parents('.existingConcept').data('conceptNodeUri'))
|
||||
},
|
||||
dataType: 'json',
|
||||
context: link, // context for callback
|
||||
|
@ -309,6 +310,14 @@ var addConceptForm = {
|
|||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
generateDeletionN3: function(conceptNodeUri) {
|
||||
var n3String = "<" + addConceptForm.subjectUri + "> <" + addConceptForm.predicateUri + "> <" + conceptNodeUri + "> .";
|
||||
//add inverse string to also be removed
|
||||
if(addConceptForm.inversePredicateUri.length > 0) {
|
||||
n3String += "<" + conceptNodeUri + "> <" + addConceptForm.inversePredicateUri + "> <" + addConceptForm.subjectUri + "> .";
|
||||
}
|
||||
return n3String;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue