Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DO_NOT_MERGE: use GET query instead of post with only type as path param #1540

Closed
wants to merge 12 commits into from

Conversation

bilalesi
Copy link
Contributor

@bilalesi bilalesi commented Jul 2, 2024

IMPORTANT do not merge

@bilalesi bilalesi changed the title use GET query instead of post with only type as path param DO_NOT_MERGE: use GET query instead of post with only type as path param Jul 2, 2024
Comment on lines 36 to 97
const SparqlParser = require('sparqljs').Parser;
const parser = new SparqlParser();

const parsedQuery = parser.parse(dataQuery);
const whereClause = parsedQuery['where'];
const type = whereClause
.reduce((acc: any, cur: any) => [...acc, ...(cur['triples'] ?? [])], [])
.find(
(k: any) =>
k.predicate.value === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'
)
?.object.value.split('/')
.pop();

const result = await fetch(
`${apiEndpoint}/views/${orgLabel}/${projectLabel}/${type}`,
{
headers: {
Accept: 'application/json',
Authorization: `Bearer ${localStorage.getItem('nexus__token')}`,
},
}
)
.then(res => res.json())
.catch(er => console.error);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the customization of the sparql query

Bilal Meddah and others added 5 commits September 16, 2024 15:56
@bilalesi bilalesi force-pushed the studio-customize-sparql-query branch from b185232 to 4fb8f51 Compare October 28, 2024 10:26
@bilalesi bilalesi closed this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants