GithubHelp home page GithubHelp logo

weso / yashe Goto Github PK

View Code? Open in Web Editor NEW
19.0 5.0 3.0 138.15 MB

Yet Another ShEx Editor.

Home Page: http://www.weso.es/YASHE/

License: MIT License

JavaScript 81.18% HTML 4.09% Shell 0.05% Prolog 6.42% SCSS 7.99% CSS 0.20% Dockerfile 0.08%
shex shape-expressions editor wikidata npm-package codemirror codemirror-editor semantic-web shex-editor codemirror-library autocompletion mediawiki-api jsdelivr javascript text-editor rich-text-editor

yashe's Issues

Document the API and clean some references to query

The folder doc contains some html files which seem to be out-of-date as they refer to queries instead of ShEx schemas.

Internally, there are also some methods like storeQuery which should be renamed to avoid confusion.

[Docs] Update Used By

  • Add WikiShape
  • Correct ShExAuthor href
  • Correct RdfShape href
  • Add more info about tools that use YASHE

Fix FontSize option

var yashe = YASHE.fromTextArea(document.getElementById('texAreaId'), {
    fontSize:30
});

Fontsize option is not working

YASHE does not recognise IMPORT

I use YASHE a lot to verify the structure of the ShEx I write. I typically copy and paste between the Wikidata editor and YASHE.
However, today I wrote a ShEx which contains an IMPORT. However, when checked on YASHE, an error was given.

afbeelding

Would it be possible to support IMPORT in YASHE?

[Grammar] Update Grammar

Current Grammar don´t support some things:

  • "import" keyword ✔️ (#103 )
  • ^^ is not recognized -> rule [129s] rdfLiteral ✔️ (#103 )
  • $ conflict between rule [40] and [42] ✔️ (#103 )

Prettyprinter Brackets Bug

This input

  <#sequence_assembly>  {
    ( p:P2576 { ps:P2576  xsd:string } |
      ps:P4333 {xsd:string    p:P4333 } )  
  }

Produces this output after call the prettyprinter:

<#sequence_assembly>  {
  ( p:P2576 {
    ps:P2576  xsd:string } xsd:string p:P4333  
  }|  ps:P4333 { )  
}

Modify pretty-printer

Currently, the pretty-printer takes all of the directives and starts and sets them at the top of the document. This is wrong because it can affect to the semantic of the document.

Embedded Wikidata Comments

By a shortcut or something like that, add Wikidata comments automatically after an entity or property.
Eg:

Before:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

<human> {
  wdt:P19 . ?;                 
  wdt:P569 . ? ;              
  wdt:P735 . * ;               
  wdt:P734 . * ;               
  wdt:P106 . * ;               
  wdt:P27 @<country> *; 	  
  wdt:P22 @<human> *;       
  wdt:P25 @<human> *;          
  wdt:P3373 @<human> *;         
  wdt:P26 @<human> *;          
  wdt:P40 @<human> *;          
  wdt:P1038 @<human> *;       
}

After:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>

<human> {
  wdt:P19 . ?;                  # place of birth
  wdt:P569 . ? ;                # date of birth
  wdt:P735 . * ;                # given name
  wdt:P734 . * ;                # family name
  wdt:P106 . * ;                # occupation
  wdt:P27 @<country> *; 	    # country of citizenship
  wdt:P22 @<human> *;           # father
  wdt:P25 @<human> *;           # mother
  wdt:P3373 @<human> *;         # sibling
  wdt:P26 @<human> *;           # spouse
  wdt:P40 @<human> *;           # children
  wdt:P1038 @<human> *;         # relatives
}

[Grammar] Fix [51] Annotation rule

Annotations has stopped working:

dct:language [ wd:Q9035 ]
    // rdf:label "language"
    // rdf:comment "The language of lexeme must be Danish." ;

I think the new REGEXP token is to blame...

Check yashe.on("changes")

A time out was added on yashe.on("change") to fix some bugs.
Maybe the timeout is not needed with yashe.on("changes") that was deleted

PrettyPrint inlineshape bug

Before PrettyPrint:

PREFIX wd:    <http://www.wikidata.org/entity/>
PREFIX wdt:   <http://www.wikidata.org/prop/direct/>

<human> {
  wdt:P31  {  wd:Q5 #asd
    .  } 
}

After PrettyPrint: (wrong output)

PREFIX wd:   <http://www.wikidata.org/entity/>
PREFIX wdt:  <http://www.wikidata.org/prop/direct/>


<human>  {
  wdt:P31  {  wd:Q5  . #asd } 
}

l14n (localization) of shape descriptions

In the Wikidata demo, when you hover over a predicate in a TripleExpression, it fetches the schema:description. Does it pick the language based on browser preferences?

It would be cool to extend this functionality by adding annotations to shapes as well, e.g.

<#P352_uniprot_id> {
	ps:P352 LITERAL ;
	prov:wasDerivedFrom IRI;
}
 // schema:description "UniProt identifier"@en
 // schema:description "identificador de UniProt"@es # just a guess

The editor could hide all of them except those in the preferred language so it wouldn't get to messy.

Update homepage info

In the features section:

  • Add share btn
  • Change "Prefix" to "Alias"

In the used by section:

  • Add WikiAuthor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.