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

1154 add loc ids #1179

Merged
merged 34 commits into from
Feb 16, 2015
Merged

1154 add loc ids #1179

merged 34 commits into from
Feb 16, 2015

Conversation

0robustus1
Copy link
Contributor

This is a partial pull-request for #1154. It shall implement loc/id support for ontologies and their subsites (e.g. children, symbols, mappings, versions). Additionally it contains loc/id support for ontology-members.

The extended loc/id support (for /ref-style domains) will be provided in a later pull-request.

This also upgrades rails as this is necessary via the dependency entry
for specroutes. Additionally it also makes sense to use the latest
bugfixes.
This is a result of `rails g specroutes:routes`.
During Ontology-Creation the loc/id field will
be set according to the definition.

This includes the generate_locid and the locid_for_child
method which generate a locid for a single-/distributed-ontology
and single-in-distributed-ontology respectively.
This includes dropping the query-string from path, as it is not
necessary for standard loc/id routes.  Additionally for ref/routes we do
not drop the leading '/' as it is necessary per loc/id definition.
This produces a url according to the requests base_url (which has the
benefit of actually using the hostname that was used to contact the
site) and the resource's locid attribute.
Additionally add mechanism to set the loc/id during
ontology-parsing.
As we currently do not have a useable symbols#show
we'll use symbols#index instead to route symbol
loc/id's.
For /children and /symbols redirect we should
also use the loc/id iri system. This will
achieve that.
Additionally add mechanism to set the loc/id during
ontology-parsing.
As we currently do not have a useable sentences#show we'll use
sentences#index instead to route sentence loc/id's.
Additionally add mechanism to set the loc/id during
ontology-parsing.
In distinction from sentences and symbols we actually do have a
page to display for mappings so we'll do exactly that when
resolving the loc/id.
This currently only includes the ontologies themselves, members of
ontologies (children, symbols, sentences, mappings) or index-routes
based on ontologies (metadata, versions and so on).
As per our API-definition we'll use a prefix of three slashes (///) to
denote an API-command. Ontology-Subsites are defined as general API
commands.
We support commands for triple-slash as additional args
to locid_for and a hash at the end for the query-strings
key-value pairs.
There is now a COMMAND part to loc/ids which is separated
from other elements by three slashes (///). We will
need to recognize that.
For some reason the proc was transformed into a method. Such a method
cannot work with `&method_name`, but must use `&:method_name`. However
that is still not feasible as we can't pass arguments to methods. That
is why we need the manual block which takes care of that.
Later on this should be fixed by providing a correct
implementation of the FormalityLevelsController.
['Metadata', locid_for(resource, :metadata), :metadata],
['Versions', locid_for(resource, :ontology_versions), :ontology_versions],
['Graphs', locid_for(resource, :graphs), :graphs],
['Mappings', locid_for(resource, :mappings), :mappings]

Choose a reason for hiding this comment

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

Style/TrailingComma: Put a comma after the last item of a multiline array.


specified_get '/:repository_id/*locid' => 'symbols#index',
as: :symbol_iri,
constraints: [

Choose a reason for hiding this comment

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

Style/AlignHash: Align the elements of a hash literal if they span more than one line.

@0robustus1
Copy link
Contributor Author

Test on jenkins probably fails because there is no libxml available, can you take care of that @eugenk?

@eugenk
Copy link
Member

eugenk commented Feb 8, 2015

Will do, but not today.

@eugenk
Copy link
Member

eugenk commented Feb 15, 2015

test this please
(This sequence in a comment triggers a new build in jenkins. This pull request should pass now.)

@eugenk
Copy link
Member

eugenk commented Feb 16, 2015

test this build

@eugenk
Copy link
Member

eugenk commented Feb 16, 2015

with fresh seeds, on http://ontohub.dev/default/partial_order//partial_order///mappings, I get:

NoMethodError at /default/partial_order/partial_order/mappings
undefined method `source' for nil:NilClass

block (2 levels) in app/views/mappings/index.html.haml:32

@eugenk
Copy link
Member

eugenk commented Feb 16, 2015

...and I see this is a problem introduced by the renaming of models. I'm creating a new branch for that one.

For this branch: 👍

0robustus1 added a commit that referenced this pull request Feb 16, 2015
@0robustus1 0robustus1 merged commit 547e1fc into staging Feb 16, 2015
@0robustus1 0robustus1 deleted the 1154-add_loc-ids branch February 16, 2015 11:31
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.

None yet

3 participants