Skip to content

Proposal for naming convention in models and views

alangrafu edited this page Mar 15, 2012 · 26 revisions

This is an solved discussion #This is an solved discussion This discussion is solved. Please refer to Creating components in LODSPeaKr to see current file structure.


TOKEN.CURIE.CONTENT-TYPE

Note: Can it be thought as CRITERIA-TYPE.MATCH-CRITERIA.CONTENT-TYPE instead?

Style convention: names ending in / are directories and those that do not are files.

TODO: directories for different endpoints needs to be added to these examples.

Matching types

models/
       |
       type.foaf:Person.html # This is a query to select attributes of the foaf:Person.
views/
       |
       type.foaf:Person.html


models/
       |
       type.foaf:Person.html/ # This is something not a query.
views/
       |
       type.foaf:Person.html/


Matching services (aka 'special' pages)

If we want to create http://example.org/myService

models/
       |
       service.myService.html # This is a query to select attributes of the foaf:Person.
views/
       |
       service.myService.html
models/
       |
       service.myService.html/ # This is something not a query.
views/
       |
       service.myService.html/

http://example.org/myService/value1/value2 gives the service two parameters, available in models/service.myService.html as {{lodspk.args.arg0}} and {{lodspk.args.arg1}}, respectively.

Matching specific URIs

If we want to treat http://example.org/people/TimLebo in a particular way (and assuming http://example.org/people/ has local as namespace):

models/
       |
       uri.local:TimLebo.html
views/
       |
       uri.local:TimLebo.html

TOKEN.CURIE/CONTENT-TYPE

Similar to above but using a dir for every content type. Everything is a dir and you are forced to create a file for queries and views below those dirs:

models/
       |
       type.foaf:Person/
                        |
                         html/
                             |
                             queryFile
                         json/
                             |
                             queryFile
views/
       |
       type.foaf:Person/
                       |
                         html/
                             |
                             htmlFile
                       |
                         json/
                             |
                             htmlFile

Clone this wiki locally