Breeze.js - + Facing issue while accessing service metata - breeze

Breeze.js - + Facing problem while accessing service metata.
Request for metadata is sent to
http://mylocalmachine:4625/WcfDataService1.svc/Metadata
but metadata is getting published at http://mylocalmachine:4625/WcfDataService1.svc/$Metadata

Your Breeze client must be configured to communicate with your remote service. As I read your question, it appears that you're trying to reach an OData data source whose data service name is "http://mylocalmachine:4625/WcfDataService1.svc".
If so, you'll have to tell Breeze to switch from its default Web Api dataService adapter to the OData dataService adapter. Do that during your application bootstrapping with a line such as:
breeze.config.initializeAdapterInstance("dataService", "OData");
Now, when you run your app and look at the network traffic, you should see that Breeze requests metadata with something like
http://mylocalmachine:4625/WcfDataService1.svc/$Metadata

There is a prerequisite JavaScript library that you will need to include on the page in order to use the OData adapater.
It's mentioned in the documentation:- dataJS.
Hope this helps.

Related

How to upload rdf-file to GraphDB over API

I have an RDF-file stored on my server. The file or at least the file-content should be uploaded to a remote GrapbDB over API.
On the documentation there are two ways to do this. The first one is uploading it to server files and then loading it to GraphDB. Here the problem is, that I am not the owner of the server, GraphDB is running. So I can`t upload it to server files. Or is there maybe another API for that?
The other way is providing a public API on my server and then trigger GraphDB to download the file from my server. But my API must be protected with credantials or JWT. But I donĀ“t know how to set the credantials in the API-Call.
Isn`t there a way to upload a simple graph to a repository?
There is a browser-based user interface in GraphDB that allows you to import from local files. If this is allowed on the server you are connecting to, and you only need to do this once then I think this would be the quickest route to go.
If you want to upload a local file to GraphDB using dotNetRDF, then I would advise you to use the SPARQL 1.1 graph store protocol API via the VDS.RDF.Storage.SparqlHttpProtocolConnector as described here. The base URL you need to use will depend on the configuration of the server and possibly also on the version of GraphDB that it is running, but for the latest version (9.4) the pattern is: <RDF4J_URL>/repositories/<repo_id>/rdf-graphs/service
The connector supports HTTP Basic Authentication (which is one of the options offered by GraphDB) so if you have a user name and password you could try the SetCredentials method on the connector to specify those credentals and if necessary force the use of HTTP Basic Authentication by setting the global options property VDS.RDF.Options.ForceHttpBasicAuth to true.

GraphQL Resolvers on client side for Apollo-iOS

How do I write a resolver for making multiple API calls to fulfil a GraphQL query using Apollo-iOS on the client side (in my swift project)?
For Example: If, to construct a Person object from a query having name and age parameters - I have to fetch name from a service call and age from another service call and stitch them to form the Person object, then how would the resolver look like and where should I write it?
Any help is appreciated.
I believe GraphQL resolvers are only a concept server-side. The client simply asks for the data. The server is supposed to resolve the query sent by the client so your resolvers should make the necessary calls to different services to be able to resolve the query completely by accessing the single endpoint.
A more in-depth explanation of resolvers in GraphQL: https://medium.com/paypal-engineering/graphql-resolvers-best-practices-cd36fdbcef55
You could write your own swift code to grab data from two separate GraphQL endpoints/services if needed.

Azure Data Factory V2 : Error using the REST connector - "Failed to get schema from"

I am doing a POC to call restFul API using ADF CopyData.
The restFul API details are available on this link
http://www.groupkt.com/post/f2129b88/free-restful-web-services-to-consume-and-test.htm
from this page, i want to rest below service
http://services.groupkt.com/country/get/iso3code/IND
The linked service to base URL is successfully created in ADF
http://services.groupkt.com/country/get
in the next steps when I try to lookup data or do next steps i get error
Error using the REST connector - "Failed to get schema from"
Let me know if you have come across this issue in ADF V2
I was able to make this POC work by changing the relative URL which i was initially giving "/iso3code/IND"
Below is how the URLs should be
Absolute URL should be http://services.groupkt.com/country/get : this is used for creating the Linked Service of the CopyData
Relative URL should be http://services.groupkt.com/country/get/iso3code/IND
This is used for getting the mapping details of the Restful service

No response when calling read() method of oData model

I have a problem that no data returns when I read an OData service via ODataModel.
But when I copy the request URL directly to web browser I can get through the odata service and the results are listed. Can you please help on this issue?
This was solved because of some CORS coding in the backend services.

Using Breeze with OData

How would I use breeze against an odata service using only the
server's metadata to define the model? Will the context still be
able to handle crud operations to a non web api service?
I have seen
// service name is route to the Web API controller
var serviceName = 'api/CarBones';
/*** dataservice proper ***/
// manager (aka context) is the service gateway and cache holder
var manager = new entityModel.EntityManager(serviceName);
Can I do something like replacing the serviceName with an oData uri
and then continue using breeze as usual?
var serviceName = "http://localhost:1234/Northwind.svc"
Thanks for your help!
This question was posted by jpirok on our IdeaBlade forums. I am reposting the question and answer here since I think it will be useful to the Breeze Stack Overflow community.
Absolutely, to switch to using an OData service simply initialize Breeze with the correct adapter. For OData this would look like:
breeze.config.initializeAdapterInstance("dataService", "OData");
Make sure you make this call before creating your first EntityManager and remember to use an OData uri as the service name.
This provides full OData query support. OData saves have not yet been implemented although they are on the near term roadmap. If you really need OData save functionality, you might want to vote for it on our Breeze User Voice https://breezejs.uservoice.com/forums/173093-breeze-feature-suggestions. We take that venue seriously in making decisions about what to do next.

Resources