Skip to content

Commit

Permalink
CellML Annotation view: updated our use of identifiers.org (#2190).
Browse files Browse the repository at this point in the history
  • Loading branch information
agarny committed Apr 2, 2020
1 parent 4735444 commit 37135d7
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 18 deletions.
Expand Up @@ -34,16 +34,16 @@ QString resourceUrl(const QString &pResource)
{
// Return the URL for the given resource

return "https://identifiers.org/"+pResource+"/?redirect=true";
return "https://registry.identifiers.org/registry/"+pResource;
}

//==============================================================================

QString idUrl(const QString &pResource, const QString &pId)
QString idUrl(const QString &pId)
{
// Return the URL for the given resource

return "https://identifiers.org/"+pResource+"/"+pId+"/?profile=most_reliable&redirect=true";
return "https://identifiers.org/"+pId;
}

//==============================================================================
Expand Down
Expand Up @@ -35,7 +35,7 @@ namespace CellMLAnnotationView {
//==============================================================================

QString resourceUrl(const QString &pResource);
QString idUrl(const QString &pResource, const QString &pId);
QString idUrl(const QString &pId);

//==============================================================================

Expand Down
Expand Up @@ -288,13 +288,12 @@ void CellmlAnnotationViewEditingWidget::updateWebViewerWithResourceDetails(WebVi
//==============================================================================

void CellmlAnnotationViewEditingWidget::updateWebViewerWithIdDetails(WebViewerWidget::WebViewerWidget *pWebViewer,
const QString &pResource,
const QString &pId)
{
// The user requested a resource id to be looked up, so retrieve it using
// identifiers.org

pWebViewer->webView()->load(idUrl(pResource, pId));
pWebViewer->webView()->load(idUrl(pId));
}

//==============================================================================
Expand Down
Expand Up @@ -102,7 +102,6 @@ private slots:
void updateWebViewerWithResourceDetails(WebViewerWidget::WebViewerWidget *pWebViewer,
const QString &pResource);
void updateWebViewerWithIdDetails(WebViewerWidget::WebViewerWidget *pWebViewer,
const QString &pResource,
const QString &pId);
};

Expand Down
Expand Up @@ -319,15 +319,14 @@ void CellmlAnnotationViewMetadataDetailsWidget::lookUpResource(const QString &pR

//==============================================================================

void CellmlAnnotationViewMetadataDetailsWidget::lookUpId(const QString &pResource,
const QString &pId)
void CellmlAnnotationViewMetadataDetailsWidget::lookUpId(const QString &pId)
{
// Let people know that we want our Web viewer to be updated with some
// details about the given id

mWebViewer->progressBarWidget()->setEnabled(true);

emit idDetailsRequested(mWebViewer, pResource, pId);
emit idDetailsRequested(mWebViewer, pId);
}

//==============================================================================
Expand Down
Expand Up @@ -112,7 +112,7 @@ class CellmlAnnotationViewMetadataDetailsWidget : public Core::Widget
void resourceDetailsRequested(WebViewerWidget::WebViewerWidget *pWebViewer,
const QString &pResource);
void idDetailsRequested(WebViewerWidget::WebViewerWidget *pWebViewer,
const QString &pResource, const QString &pId);
const QString &pId);

public slots:
void updateGui(iface::cellml_api::CellMLElement *pElement);
Expand All @@ -122,7 +122,7 @@ private slots:

void lookUpQualifier(const QString &pQualifier);
void lookUpResource(const QString &pResource);
void lookUpId(const QString &pResource, const QString &pId);
void lookUpId(const QString &pId);
void lookUpNothing();

void removeAllMetadata();
Expand Down
Expand Up @@ -561,7 +561,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::updateItemsGui(const CellmlA
mUrls.insert(item.resource(), resourceUrl(item.resource()));
}

mUrls.insert(itemInformation, idUrl(item.resource(), item.id()));
mUrls.insert(itemInformation, idUrl(item.id()));

mItemInformationSha1s << itemInformationSha1;

Expand Down Expand Up @@ -723,7 +723,7 @@ void CellmlAnnotationViewMetadataEditDetailsWidget::genericLookUp(const QString

break;
case InformationType::Id:
emit idLookUpRequested(resource, id);
emit idLookUpRequested(id);

break;
}
Expand Down
Expand Up @@ -187,7 +187,7 @@ class CellmlAnnotationViewMetadataEditDetailsWidget : public Core::Widget
signals:
void qualifierLookUpRequested(const QString &pQualifier);
void resourceLookUpRequested(const QString &pResource);
void idLookUpRequested(const QString &pResource, const QString &pId);
void idLookUpRequested(const QString &pId);
void noLookUpRequested();

public slots:
Expand Down
Expand Up @@ -306,7 +306,7 @@ void CellmlAnnotationViewMetadataNormalViewDetailsWidget::addRdfTriple(CellMLSup
mUrls.insert(pRdfTriple->resource(), resourceUrl(pRdfTriple->resource()));
}

mUrls.insert(rdfTripleInformation, idUrl(pRdfTriple->resource(), pRdfTriple->id()));
mUrls.insert(rdfTripleInformation, idUrl(pRdfTriple->id()));

mRdfTripleInformationSha1s << rdfTripleInformationSha1;

Expand Down Expand Up @@ -431,7 +431,7 @@ void CellmlAnnotationViewMetadataNormalViewDetailsWidget::genericLookUp(const QS

break;
case InformationType::Id:
emit idLookUpRequested(resource, id);
emit idLookUpRequested(id);

break;
}
Expand Down
Expand Up @@ -140,7 +140,7 @@ class CellmlAnnotationViewMetadataNormalViewDetailsWidget : public Core::Widget
signals:
void qualifierLookUpRequested(const QString &pQualifier);
void resourceLookUpRequested(const QString &pResource);
void idLookUpRequested(const QString &pResource, const QString &pId);
void idLookUpRequested(const QString &pId);
void noLookUpRequested();

void rdfTripleRemoved(CellMLSupport::CellmlFileRdfTriple *pRdfTriple);
Expand Down

0 comments on commit 37135d7

Please sign in to comment.