Skip to content

Commit

Permalink
allow adding URN URIs
Browse files Browse the repository at this point in the history
  • Loading branch information
ali1k committed Dec 9, 2019
1 parent 89d9bc6 commit f03c92f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion data/prefixes.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@ module.exports = {
'uniprot': 'http://purl.uniprot.org/core/',
'unit': 'http://qudt.org/vocab/unit#',
'units': 'http://eulersharp.sourceforge.net/2003/03swap/unitsExtension#',
'urn': 'http://fliqz.com/',
'user': 'http://schemas.talis.com/2005/user/schema#',
'usgov': 'http://www.rdfabout.com/rdf/schema/usgovt/',
'uta': 'http://uptheasset.org/ontology#',
Expand Down
4 changes: 2 additions & 2 deletions services/sparql/ImportQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ class ImportQuery{
let propsSt = '';
for(let prop in node){
if(prop && prop !== '@type' && prop !=='@id'){
propsSt = propsSt + `${validUrl.is_web_uri(prop.toString()) ? '<'+prop+'>': prop} ${validUrl.is_web_uri(node[prop].toString()) ? '<'+node[prop]+'>': '"""'+node[prop]+'"""'} ; `;
propsSt = propsSt + `${validUrl.isUri(prop.toString()) ? '<'+prop+'>': prop} ${validUrl.isUri(node[prop].toString()) ? '<'+node[prop]+'>': '"""'+node[prop]+'"""'} ; `;
}
}
this.query = this.query + `
INSERT DATA {
${gStart}
${validUrl.is_web_uri(node['@id'].toString()) ? '<'+node['@id']+'>': node['@id']} a ${node['@type']} ;
${validUrl.isUri(node['@id'].toString()) ? '<'+node['@id']+'>': node['@id']} a ${node['@type']} ;
${propsSt}
${userSt}
ldr:createdOn "${currentDate}"^^xsd:dateTime .
Expand Down
2 changes: 1 addition & 1 deletion services/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default {
case 'bnode':
case 'literal':
// automatically detect uris even in literal values
if(validUrl.is_web_uri(objectValue.toString())){
if(validUrl.isUri(objectValue.toString())){
newValue='<'+objectValue+'>';
dtype = 'uri';
}else{
Expand Down

0 comments on commit f03c92f

Please sign in to comment.