-
Notifications
You must be signed in to change notification settings - Fork 15
Proposal for naming convention in models and views
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.
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.
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/
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.
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
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