diff --git a/server/routes/api/utilities.js b/server/routes/api/utilities.js index 7ee8b95..f0bb1b8 100644 --- a/server/routes/api/utilities.js +++ b/server/routes/api/utilities.js @@ -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') diff --git a/server/util/sparql/endpoint-queries.js b/server/util/sparql/endpoint-queries.js index 6b2f034..c58e7fa 100644 --- a/server/util/sparql/endpoint-queries.js +++ b/server/util/sparql/endpoint-queries.js @@ -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) @@ -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}>`); - } } @@ -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;