ember-prism icon indicating copy to clipboard operation
ember-prism copied to clipboard

SPARQL language not working

Open Youssef-98 opened this issue 4 years ago • 5 comments

I'm trying to show some queries in sparql but it seems that it doesn't work. My code is:

<CodeBlock 
  @language="sparql,rq"
  @code="
  PREFIX ext: <http://mu.semte.ch/vocabularies/ext/>
  PREFIX schema: <http://schema.org/>

  SELECT ?book ?bookTitle {
    GRAPH <http://mu.semte.ch/application> {
      ?book a schema:Book.
      ?book schema:title ?bookTitle.
    }
  }" 
/>

But it just gives an empty box with nothing, except when I remove the language attribute, then it works, but then there's no highlight on the code. Any reason as to why this happens?

Youssef-98 avatar Aug 26 '21 12:08 Youssef-98

@Youssef-98 I think you'll have to install those extra languages with prism. I don't know if they are included by default?

RobbieTheWagner avatar Aug 26 '21 12:08 RobbieTheWagner

@Youssef-98 I think you'll have to install those extra languages with prism. I don't know if they are included by default?

I don't think you can install those languages seperately (not that I see in the documentation). It just says that the @language should include languages that are listed as supported languages in following link: https://prismjs.com/#supported-languages

Youssef-98 avatar Aug 26 '21 12:08 Youssef-98

@Youssef-98 sorry, what I mean is adding it to the config.

  'ember-prism': {
    'components': ['sparql'], 
  }

All languages are not auto added, you have to configure which ones you want, I think.

RobbieTheWagner avatar Aug 26 '21 14:08 RobbieTheWagner

@Youssef-98 sorry, what I mean is adding it to the config.

  'ember-prism': {
    'components': ['sparql'], 
  }

All languages are not auto added, you have to configure which ones you want, I think.

I tried that as well. I tried it with rq and sql and all of them break the app.

Youssef-98 avatar Aug 26 '21 15:08 Youssef-98

@Youssef-98 you'll want to use:

  'ember-prism': {
    'components': ['sparql'], 
  }

If you have a reproduction using that config and using sparql in your templates, please send it over, but it should work if configured correctly.

RobbieTheWagner avatar Aug 26 '21 16:08 RobbieTheWagner