How do I upload a "large" GeoJSON file to a Mapbox Dataset? - mapbox

I have a 17.7mb GeoJSON file. I tried creating a new Mapbox Dataset with it through the web UI but got an error saying for files over 5mb you have to use the Datasets API.
I then tried to use the API:
curl -X POST "https://api.mapbox.com/datasets/v1/${MAPBOX_USERNAME}?access_token=${MAPBOX_ACCESS_TOKEN}" \
-d #ne_10m_coastline.json \
--header "Content-Type:application/json"
But got the following error:
{"message":"request entity too large"}
I don't see anything in the API docs about file size restrictions, and as GeoJSON files go, 17.7mb is pretty small.
How can I create a Mapbox Dataset with my file?

Related

Unable to import test results to jira via rest api

i'm using the following curl command to import the output.xml file into jira test execution key and receiving error as below. I'm sure the test execution key is existing in jira and the project id is also correct. Any pointers?
curl -H "Content-Type: multipart/form-data" -u userid:pass -F "file=#output.xml" "https://server/rest/raven/latest/import/execution/robot?projectKey=PROJKEY+and+testExecKey=TESTEXNKEY" -o error.txt
The error i receive is as below
The User "userid" does not have permission to create issues
Why does it try to create new issue while the issue already exists? And why does it say the user doesn't have access when the access is there?
You probably mean Xray add-on and you probably use the same request per their documentation. The problem seems to be with your parameter syntax. It should be .../robot/?projectKey=PROJKEY&testExecKey=TESTEXNKEY (i.e. & instead of +and+).
Plus I would explicitly specify it's a POST request: curl -X POST ....
But their error message is not clear, anyway. I don't have Xray available right now, but if you keep having troubles, I would recommend checking with their support.

Rest API to get list of artifacts from Nexus OSS 3.x Repository

I have created a raw repository in Nexus 3.x and I'm able to upload artifacts to the same. Now I want get the list of all artifacts residing inside that repo using Rest API.
Any help is appreciated.
in the current Nexus3.14.0-04 the REST API has become final (no longer "beta") and the curl you need is:
curl -X GET "http://localhost:8081/service/rest/v1/components?repository=central" -H "accept: application/json"
this will return each "component" (group, name, version) with all its assets = each individual file (pom, sha1, md5, jar) who constitue the component
The result is a JSON string.
If instead you want to perform a COMPONENTS search - based on a groupId, artifactId - you can use this curl:
curl -X GET "http://localhost:8081/service/rest/v1/search?repository=central&format=maven2&maven.groupId=com.fasterxml.jackson.core&maven.artifactId=jackson-core&maven.extension=jar" -H "accept: application/json"
this returns COMPONENTS with child ASSETS.
The variant to retrieve only the ASSETS, without grouping them by COMPONENT, is GET /service/rest/v1/search/assets?repository=central&format=maven2&maven.groupId=com.fasterxml.jackson.core&maven.artifactId=jackson-core&maven.extension=jar
You can use the - still in beta - new API for Nexus. It's available by default on the version 3.3.0 and more: http://localhost:8082/swagger-ui/
Basically, you retrieve the json output from this URL: http://localhost:8082/service/siesta/rest/beta/assets?repositoryId=YOURREPO
Only 10 records will be displayed at a time and you will have to use the continuationToken provided to request the next 10 records for your repository by calling: http://localhost:8082/service/siesta/rest/beta/assets?continuationToken=46525652a978be9a87aa345bdb627d12&repositoryId=YOURREPO
More information here: http://blog.sonatype.com/nexus-repository-new-beta-rest-api-for-content

How do I upload a file with metadata to jfrog artifactory with curl

I upload a file like this:
curl -u ${CREDS} --upload-file ${file} ${url}
Is there a way to add a body or headers that will set some metadata for the file? Like build number.
You can actually deploy artifacts with properties to Artifactory OSS using matrix parameters, for example:
curl -uadmin:password -T file.tar "http://localhost:8081/artifactory/generic-local/file.tar;foo=bar;"
And get the artifact properties using REST API, for example:
curl -uadmin:password "http://localhost:8081/artifactory/api/storage/generic-local/file.tar?properties"
Viewing properties from the UI and other features are limited to the Pro edition.
Seems this is a pro feature. Documentation: Set Item Properties
PUT /api/storage/{repoKey}{itemPath}?properties=p1=v1[,v2][|p2=v3][&recursive=1]
Not helping me :-/

Cannot set more than one Meta data with OpenStack Swift Object

I am trying to set metadata with a Object stored in Swift Container. I am using following command (note that my container is 'container1' and object is 'employee.json':
curl -X POST -H "X-Auth-Token:$TOKEN" -H 'X-Object-Meta-metadata1: value' $STORAGE_URL/container1/employee.json
It works fine with one metadata. But whenever, I am trying to set more than one metadata issuing several curl commands, only the last metadata value is actually set.
I think, there should not be a limit that you can set only one metadata for a swift object. Am I doing anything wrong?
FYI: I am using Havana release of Openstack Swift.
Thank you.
I think, I have figured it out... Its my bad that I did not read documentation sincerely.
It [1] says, "A POST request will delete all existing metadata added with a previous PUT/POST."
So, I tried this and it worked...
curl -X POST -H "X-Auth-Token:$TOKEN" -H 'X-Object-Meta-p1:[P1]' -H 'X-Object-Meta-p2:[P1]' $STORAGE_URL/container1/employee.json
Here, instead of two POST requests, now I have set multiple metadata in a single POST request.
Again, thanks.
Ref:
http://docs.openstack.org/api/openstack-object-storage/1.0/content/update-object-metadata.html

How do I consume a sparql endpoint - such as DBPedia in an iphone app

I am looking for tutorials on how to consume and parse data from a sparql endpoint such as DBPedia. I am new to semantic web and rdf and sparql. Would I just treat the response as XML and use one of the many third party xml parsers to read rdf input?
A link to a good tutorial for consuming sparql endpoints on the iphone would be great
You send the query as a HTTP GET request, and parse the result (usually XML or JSON, you can request either) using an XML or JSON parser.
For example the query:
http://dbpedia.org/sparql?query=SELECT+DISTINCT+?concept+WHERE+{+?s+a+?concept+}+LIMIT+50
Will run the SPARQL query:
SELECT DISTINCT ?concept
WHERE {
?s a ?concept .
} LIMIT 50
And return the results in XML.
You can test this in curl with:
$ curl -g 'http://dbpedia.org/sparql?query=SELECT+DISTINCT+?concept+WHERE+{+?s+a+?concept+}+LIMIT+50'
If you set the Accept: header you can control the return type, e.g. in curl:
$ curl -g -H 'Accept: application/json' 'http://dbpedia.org/sparql?query=SELECT+DISTINCT+?concept+WHERE+{+?s+a+?concept+}+LIMIT+50'