Skip to content

Commit

Permalink
class_roles
Browse files Browse the repository at this point in the history
  • Loading branch information
LeldeLace committed Mar 21, 2024
1 parent 94def0d commit 8806dc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions server/routes/api/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const get_KNOWN_DATA2 = async () => {
db_info.profile_data = tree_profiles.filter(function(t){ return t.profile_name == tree_profile_name;})[0].data;
db_info.schema_name = r2.filter(function(p){ return p.name == 'schema_kind';})[0].textvalue;
db_info.direct_class_role = r2.filter(function(p){ return p.name == 'direct_class_role';})[0].textvalue;
if ( db_info.direct_class_role == undefined )
db_info.direct_class_role = 'rdf:type';
db_info.indirect_class_role = r2.filter(function(p){ return p.name == 'indirect_class_role';})[0].textvalue;
db_info.use_pp_rels = r2.filter(function(p){ return p.name == 'use_pp_rels';})[0].jsonvalue;
if ( r2.filter(function(p){ return p.name == 'instance_lookup_mode';})[0].textvalue == 'table')
Expand Down
6 changes: 4 additions & 2 deletions server/util/sparql/endpoint-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,10 @@ const sparqlGetPropertiesFromClass = async (schema, params, pos, uriClass, only_
const executeSPARQL = async (endpointUrl, querySparql) => {
let client = await findClient(endpointUrl);
console.log('--------executeSPARQL-----------------')
if ( querySparql == undefined)
return [];
console.log(querySparql)

if (querySparql.toLowerCase().startsWith('ask')) {
const reply = await client.query.ask(querySparql);
console.log(reply)
Expand Down Expand Up @@ -509,7 +512,6 @@ const sparqlGetIndividualsNew = async (schema, params) => {
individualPattern = await getIndividualPattern(schema, params, clInfo[0].iri);
const classInfo = await getClassSparqlPart(schema, params, clInfo[0].iri);
whereList.push(classInfo); //(`?x ${typeString} <${clInfo[0].iri}>`);

}
}

Expand All @@ -533,7 +535,7 @@ const sparqlGetIndividualsNew = async (schema, params) => {
if (newPList.out.length > 0 )
newPList.out.forEach(element => whereList.push(`?x <${element}> []`));
}

reply = await getFullResults(schema, endpointUrl, whereList, params, individualPattern);
reply.forEach(v => { rr.push(v.localName);} );
return rr;
Expand Down

0 comments on commit 8806dc9

Please sign in to comment.