Example input for "paths" field in Phabricator Conduit API endpoint "diffusion.lastmodifiedquery" - phabricator

What input does the "paths" field on https://secure.phabricator.com/conduit/method/diffusion.lastmodifiedquery/ accept? I've tried out various inputs such as {"0":"file_path.py"}, {"0":"/<entire_directory_path>/file_path.py"} etc.

Use this syntax:
{ "paths": ["/<entire_directory_path>/file_path.py"] }
the key of the needed map is paths where its value is an array of paths.

Related

What is GRAPHDB_CONTEXT_TEST in Graphdb?

I am trying to set a new repository in GraphDB. The npm documentation say that
GRAPHDB_CONTEXT_TEST = 'http://ont.enapso.com/repo'; where is this "http://ont.enapso.com/repo" coming from?
Also, why do we need { prefix: 'entest', iri: 'http://ont.enapso.com/test#' } ?
In the test repository, it is:
But I don't understand if the inside the quotes is just a string, or a link?
GRAPHDB_CONTEXT_TEST = 'http://ont.enapso.com/repo';
This is the global variable in which we have 'http://ont.enapso.com/repo', which is to define which named graph would be used.
{ prefix: 'entest', iri: 'http://ont.enapso.com/test#' }
These are the prefixes that we could pass in along with their IRI. They are used to perform SPARQL queries which require your prefixes.
We pass the IRI inside the quotes referred to as an internationalized resource identifier. It is used to identify uniquely.
You can also check the updated documentation of the pack available at
ENAPSO GraphDB Client
ENAPSO GraphDB Admin
Hope that answers your questions.

Is there a way to reduce time complexity on the frontend with using Drupal json-api includes?

I'm currently working with an output from the Drupal json-api module and have noticed that the structure of an output forces an O(n^2) time complexity issue on the front by forcing the front end developers to reformat the json output given to them so an attachment can me in the same object as the entity it belongs to.
Example
So let's say I'm listing a bunch of categories with their thumbnails to be used on the front end. What a json output would normally look like for that is something like:
Normal category json structure
[
{
"uid":123,
"category_name":"cars",
"slug":"cars",
"thumbnail":"example.com/cars.jpg"
},
{
"uid":124,
"category_name":"sports",
"slug":"sports",
"thumbnail":"example.com/sports.jpg"
}
]
With drupal it seems that thumbnails are in their own includes separate from data creating an O(n^2). For example:
I make a get request using this endpoint:
example.com/jsonapi/taxonomy_term/genre?fields[taxonomy_term--genre]=name,path,field_genre_image,vid&include=field_genre_image
The structure of the data returned from the drupal json api module is going to be similar to this:
pseudo code for better readability
{
"data":[
{
"uid":123,
"category_name":"cars",
"slug":"cars",
"relationships":{
"thumbnail":{
"id":123
}
}
},
{
"uid":124,
"category_name":"sports",
"slug":"sports",
"relationships":{
"thumbnail":{
"id":124
}
}
}
],
"included":[
{
"type":"file",
"id":123,
"path":"example.com/cars.jpg"
},
{
"type":"file",
"id":124,
"path":"example.com/sports.jpg"
}
]
}
The problem with the drupal output is that I have to loop through the data and then in the data loop loop through the includes and attach each thumbnail to the category causing an O(n^2) on the frontend.
Is there a way for the frontend to request a category using the drupal json module to contain the thumbnail in the category like the normal json output above without having to restructure the json api on the frontend?
Please note I am not a drupal developer so the terminology I might use will be off.
JSON:API can output a list of entities and includes another list of entities (can have different types). each entity has UUID, so, accessing them can be O(logn) or even O(0) if you apply index to their UUID
So, you would have one loop to parse each of the included entity and store and index them (like SQLite), or simply loop over all included entities, build 1 array key by UUID and value is object of an entity

Using r googledrive package to create custom property

According to the documentation for drive_mkdir() in the googledrive package, "Named parameters to pass along to the Drive API. Has the tidy dots semantics that come from using rlang::list2(). You can affect the metadata of the target file by specifying properties of the Files resource via .... Read the "Request body" section of the Drive API docs for the associated endpoint to learn about relevant parameters." In the Google Drive API, it lists adding custom properties as, "Custom file properties are key/value pairs used to store custom metadata for a file, such as tags, IDs from other data stores, information shared between workflow applications, and so on.
To add properties visible to all apps, use the properties field of files resource."
In the Google API Files Page, it lists it as
"properties": {
(key): string}
I've tried a number of different ways to pass a value, but nothing seems to work. Does anyone have an example of adding a custom property while creating a folder?
Here is one example I've tried that does not work:
GDriveTarget <- "https://drive.google.com/drive/u/1/folders/'etc'"
drID <- drive_get(GDriveTarget, verbose = TRUE)
gProps <-list2(properties = c("Region","Far Northeast"))
curFolder <- drive_mkdir(name="School Folders",
path=GDriveTarget,
gProps)
this results in:
Error: These parameters are unknown:
Backtrace:
googledrive::drive_mkdir(...)
googledrive::drive_create(...)
googledrive::request_generate(...)
gargle::request_develop(endpoint = ept, params = params)
gargle:::check_params(params, endpoint$parameters)
gargle:::stop_bad_params(unknown, reason = "unknown")
Removing "gProps" creates the desired folder, so I have the proper rights. I'm just unsure how to pass the parameters Google is expecting. When I use the "try this API" tool on Google Developer, what it is expecting is:
{
"properties": {
"Region": "Far Northeast"
}
}

Using parameters in Azure Service Bus Subscription SqlFilter expression

I am using an ARM template to try and deploy a subscription to an Azure Service Bus Topic which filters messages based on the To system property. I would like to pull the value for the filter from an ARM template parameter, but I can't seem to get the template to resolve the param in the SqlExpression.
Below is the template I have been messing around with. I thought I could maybe just toggle the requiresPreprocessing switch to get it to resolve the param on deployment, but no dice. I also played with trying to escape it using double square brackets or colons as shown in the link below
https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-messaging-sql-filter#propertyname
{
"apiVersion": "2017-04-01",
"name": "[concat(parameters('mynamespace'), '/', parameters('topic'), '/', parameters('myVariable'),'/direct')]",
"type": "Microsoft.ServiceBus/namespaces/topics/subscriptions/rules",
"dependsOn": [
"[resourceId('Microsoft.ServiceBus/namespaces', parameters('mynamespace'))]",
"[resourceId('Microsoft.ServiceBus/namespaces/topics', parameters('mynamespace'), parameters('topic'))]",
"[resourceId('Microsoft.ServiceBus/namespaces/topics/subscriptions', parameters('mynamespace'), parameters('topic'), parameters('myVariable'))]"
],
"properties": {
"filterType": "SqlFilter",
"sqlFilter": {
"sqlExpression": "sys.To=[parameters('myVariable')] OR sys.To IS NULL",
"requiresPreprocessing": true
}
}
What I am getting is the string exactly as it is displayed in the sqlExpression, but I would like to get the value that the variable resolves to in a single quoted string.
This topic subscription rules may only get static values. Maybe you can try with a static value instead of [parameters('myVariable')]. This problem might because of giving dynamic value to the property sys.To.
You could use: "[concat('sys.To=',[parameters('myVariable')],' OR sys.To IS NULL')]".
You cannot use inline expressions in an ARM template I think, therefor you should make the whole thing an expression and in this case use concat to glue the parts together.
Hint: including single quotes is difficult, so a variable like this might come in handy:
"SQ": "'"

Filter property based searches in Artifactory

I'm looking to use the Artifactory property search
https://www.jfrog.com/confluence/display/RTF/Artifactory+REST+API#ArtifactoryRESTAPI-ArtifactSearch%28QuickSearch%29
Currently this will pull json listing any artifact that matches my properties.
"results" : [
{
"uri": "http://localhost:8080/artifactory/api/storage/libs-release-local/org/acme/lib/ver/lib-ver.pom"
},{
"uri": "http://localhost:8080/artifactory/api/storage/libs-release-local/org/acme/lib/ver2/lib-ver2.pom"
}
]
I need to be able to filter the artifacts I get back as i'm only interested in a certain classifier. The GAVC Search has this with &c=classifier
I can do it in code if this isn't possible via the interface
Any help appreciated
Since the release of AQL in Artifactory 3.5, it's now the official and the preferred way to find artifacts.
Here's an example similar to your needs:
items.find
(
{
"$and":[
{"#license":{"$eq":"GPL"}},
{"#version":{"$match":"1.1.*"}},
{"name":{"$match":"*.jar"}}
]
}
)
To run the query in Artifactory, copy the query to a file and name it aql.query
Run the following command from the directory that contains the aql.query file
curl -X POST -uUSER:PASSWORD 'http://HOST:PORT/artifactory/api/search/aql' -Taql.query
Don't forget to replace the templates (USER, PASSWORD,HOST and PORT) to real values.
In the example
The first two criteria are used to filter items by properties.
The third criteria filters items by the artifact name (in our case the artifact name should end with .jar)
For more details on how to write AQL query are in AQL
Old answer
Currently you can't combine the property search with GAVC search.
So you have two options:
Executing one of them (whichever gives you more precise results) and then filter the JSON list on the client by a script
Writing an execution user plugin that will execute the search by using the Searches service and then filter the results on the server side.
Of course, the later is preferable.

Resources