AlchemyAPI get link for all entity - alchemyapi

In Alchemy API, is it possible to get links for all entity even though they are not disambiguated.
e.g.
<entity>
<type>Country</type>
<relevance>0.33</relevance>
<count>2</count>
<text>britain</text>
</entity>
Even though britain is not ambigious, I want to get the linked data URL for dbpedia. More precisely, I want to get linked data for all entity

AlchemyAPI only provides the linked data only for entities that have been disambiguated. So unfortunately what you want to do is not possible at this time.
From the docs:
"Whenever an entity is successfully disambiguated, additional
information is returned in API responses. This includes the fully
resolved, disambiguated entity name, and if available, the entity's
website and geographic coordinates."

Related

when to use explicit relations - schema design

I am pondering about schema design with regard to explicit vs implicit relation when to...
for example:
in an imaginary schema with 2 custom types author and post, each with several properties, A post type can reference an author in 1 of 2 ways:
explicit: having an Autor type property
implicit: having a scalar value that indirectly points to the author
when designing a shema. what should be my compass in this kind of desicion making?
thanks in advance
There's absolutely no value to the client in only returning the ID of a related resource when you could just expose a field that would return the entire resource. Exposing only the ID will mean the client will have to make subsequent requests to your service to fetch the related resources, instead of being able to fetch the entire data graph in one request.
In the context of other services, like a REST API, it might make sense to only return the ID or URL of a related resource. This is because in those cases, the payload is of a fixed size, so returning every related resource by default can quickly and unnecessarily bloat a response. In GraphQL, however, request payloads are client-driven so this is not a concern -- the client will always get exactly what it asks for. If the client needs only the author's ID, they may still fetch just that field through the author field -- while allowing a more complete Author object to be fetched in other requests or by other clients.

FHIR URL - Read Based on Existing Patient

I'm building a FHIR client in .NET using the test server in the following request: http://argonaut.healthintersections.com.au/open/Patient?family=Doe&given=John. I am able to successfully return and parse JSON response for an existing test patient. My use case: Now that I know that my patient of interest exists I want to return problems/medications/immunizations for the patient.
Can someone please tell me how I can turn around the patient information (presumably patient id) received in the JSON response and request all medications or immunizations or problems for said patient? I've tried quite a few ways based on my interpretation of the documentation (trying to leverage resource type of StructuredDefinition defined in the specification, but I cannot seem to get it right. Excerpt from the JSON response showing patient id returned from server:
"entry":[
{
"resource":{
"resourceType":"Patient",
"id":"4705152-patient",
"meta":{
"versionId":"1",
"lastUpdated":"2015-05-04T13:41:19Z"
},
Thank you
Two different answers, depending how you want to go about it. If you want to get a dump of the whole patient record, you can do this:
http://argonaut.healthintersections.com.au/open/Patient/475152-patient/$everything. That will give you Lists, Conditions, Allergies, Medications, etc. - everything in the patient compartment for that patient. (You can filter by "since" and a couple of other parameters).
You can also go after the resources individually:
http://argonaut.healthintersections.com.au/open/Condition?patient=475152-patient
Side-note: I just queried the healthintersections argonaut server for the patient id you specified in your example and didn't find it, so I tested my queries using patient "1".
You'll need to be authorized via OAuth in order to get this data back
EDIT: Updated to reflect that non-availability is due to lack of OAuth authentication, not Argonaut intention
You could also use _revinclude to directly include these associated resources in the query response. See the search specification page.

IBM SBT SDK: How can I limit search results of CommunityService.getPublicCommunities(params)?

When I call communityService.getMyCommunities(params) or communityService.getPublicCommunities(params) or communityService.getSubCommunities(parentCommunity, params) I would expect that filling params with e. g. tags=[mytag,yourtag] the call would only lookup communities having at least one of these tags (or both, however).
But to me it looks like this param ("tags") is simply ignored, and I always receive all communities of the given category (my / public / sub).
In case of having lots of communities of the requested category this massively slows down performance when I only want to retrieve communities with e. g. one certain tag: I receive all data over the net and must filter / lookup the received object list locally.
What am I doing wrong?
Is there something missing in the SDK implementation?
As part of the communities/my api, you cannot do any filtering... you need to use Search APIs.
In order to get a filtered list of communities based on the tags, you need to make a request to the following URL.
https://apps.na.collabserv.com/search/atom/mysearch?scope=personalOnly&scope=communities&query=&constraint={%22type%22%3A%22category%22%2C%22values%22%3A[%22Tag%2Fprb%22]}&page=1&pageSize=10
Yes, it is URL encoded, you can then change prb to match your tag, and you can repeat the constraints for each tag
You can also reference Link to Search API Constraints

Filter the form choices visible in the browseable API

I am using a filter to apply object level permissions to a collection. Resources in a second collection have a many-to-many relationship with the first. On the browsable API, when creating resources in the second collection, the user is presented with a list of resources from the first to link it to. However, this list is not filtered, so the user can see values that they should not be able to see.
I've poked around the documentation and source a bit and I cannot see a way to add filtering to the queryset that generates the choices without overloading or modifying a bunch of code to pass the request data down (probably removing some of the collection specific data on the way) and then apply the filters.
Is there a better way to achieve this?
Currently there's nothing to support this out of the box. Pull requests are always welcome. If it's something you want to work on you may want to either open a ticket on GitHub or hit up the mailing list to discuss it first.

Django client side query construction

I'm making a pretty standard AJAXy (well, no XML actually) web page. The browser makes a bunch of API queries that return JSON to run the site. The problem is, I need to add to the API interface each time the page needs to do something new. The new API interface is usually little more than a database query followed by mapping the returned objects to JSON.
What I'd like to do is to get rid of all that server-side duplication and just have the page make database requests itself (using the model interface), but in a way that is safe (i.e. just read only ones). I think this would amount to an interface for constructing Q objects using JSON or something like that, and then send that up to the server, run the query, and return the results. Before I go making my own half-broken architecture for this, I'm wondering if this has already been done well. Also, is this even the best way to go about eliminating this duplication?
Thanks
Search multiple fields of django model without 3rd party app
Django SQL OR via filter() & Q(): Dynamic?
Generate a django queryset based on dict keys
Just replace with operator.and_ where appropriate.

Resources