Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions css/expdb.css
Original file line number Diff line number Diff line change
Expand Up @@ -2762,11 +2762,10 @@ a.bold:hover{
font-weight: 100;


width: 76px;
height: 76px;
width: 100px;
height: 100px;
padding: 0px;

background: #fff;
color: #fff;
display:block;
position: relative;
Expand All @@ -2793,10 +2792,9 @@ a.bold:hover{
}

.arc {
height: 84px;
width: 84px;
left: -3px;
top: -5px;
height: 100px;
width: 100px;
top: -15px;
position: absolute;
box-shadow: 0 0 4px rgba(0,0,0,.14),0 4px 8px rgba(0,0,0,.28);

Expand Down
72 changes: 65 additions & 7 deletions downloads/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1979,6 +1979,7 @@
"evaluation" : [ {
"run_id" : "1",
"task_id" : "68",
"uploader" : "1",
"flow_id" : "61",
"function" : "area_under_roc_curve",
"upload_time" : "2014-04-06 23:30:40",
Expand All @@ -1987,6 +1988,7 @@
}, {
"run_id" : "1",
"task_id" : "68",
"uploader" : "1",
"flow_id" : "61",
"function" : "f_measure",
"upload_time" : "2014-04-06 23:30:40",
Expand All @@ -1995,6 +1997,7 @@
}, {
"run_id" : "1",
"task_id" : "68",
"uploader" : "1",
"flow_id" : "61",
"function" : "predictive_accuracy",
"upload_time" : "2014-04-06 23:30:40",
Expand Down Expand Up @@ -2237,16 +2240,16 @@
"parameters" : [ {
"name" : "id",
"in" : "path",
"description" : "Id of the study.",
"description" : "Id of the study. Supplied in the URL path.",
"required" : true,
"type" : "number",
"format" : "integer"
}, {
"name" : "description",
"name" : "ids",
"in" : "formData",
"description" : "An XML file describing the entities to be attached. Also see the [XSD schema](https://www.openml.org/api/v1/xsd/openml.study.attach) and an [XML example](https://www.openml.org/api/v1/xml_example/attach).",
"description" : "Comma-separated list of entity IDs to be attached to the study. For instance, if this is a run study, the list of run IDs that need to be added (attached) to the study. Must be supplied as a POST variable.",
"required" : true,
"type" : "file"
"type" : "string"
}, {
"name" : "api_key",
"in" : "query",
Expand Down Expand Up @@ -2292,11 +2295,11 @@
"type" : "number",
"format" : "integer"
}, {
"name" : "description",
"name" : "ids",
"in" : "formData",
"description" : "An XML file describing the entities to be detached. Also see the [XSD schema](https://www.openml.org/api/v1/xsd/openml.study.detach) and an [XML example](https://www.openml.org/api/v1/xml_example/detach).",
"description" : "Comma-separated list of entity IDs to be detached from the study. For instance, if this is a run study, the list of run IDs that need to be removed (detached) from the study. Must be supplied as a POST variable.",
"required" : true,
"type" : "file"
"type" : "string"
}, {
"name" : "api_key",
"in" : "query",
Expand Down Expand Up @@ -2359,6 +2362,31 @@
}
}
},
"/user/list" : {
"get" : {
"tags" : [ "user" ],
"summary" : "List all users by user id",
"description" : "Returns an array with all user ids and names.\n",
"parameters" : [ {
"name" : "api_key",
"in" : "query",
"description" : "API key to authenticate the user",
"required" : false,
"type" : "string"
} ],
"responses" : {
"200" : {
"description" : "A list of users",
"examples" : {
"application/json" : "{\n \"users\":{\n \"user\":[\n {\n \"id\":\"1\",\n \"username\":\"janvanrijn@gmail.com\"},\n {\n \"id\":\"2\",\n \"username\":\"joaquin.vanschoren@gmail.com\"}\n ]\n }\n}"
},
"schema" : {
"$ref" : "#/definitions/UserList"
}
}
}
}
},
"/evaluationmeasure/list" : {
"get" : {
"tags" : [ "evaluationmeasure" ],
Expand Down Expand Up @@ -2402,6 +2430,14 @@
}
}
},
"UserList" : {
"type" : "object",
"properties" : {
"users" : {
"$ref" : "#/definitions/UserList_users"
}
}
},
"Task" : {
"type" : "object",
"properties" : {
Expand Down Expand Up @@ -3146,6 +3182,28 @@
}
}
},
"UserList_users_user" : {
"properties" : {
"id" : {
"type" : "string",
"description" : "The user ID"
},
"username" : {
"type" : "string",
"description" : "The full user name"
}
}
},
"UserList_users" : {
"properties" : {
"user" : {
"type" : "array",
"items" : {
"$ref" : "#/definitions/UserList_users_user"
}
}
}
},
"Task_task_description_data_set" : {
"properties" : {
"data_set_id" : {
Expand Down
68 changes: 61 additions & 7 deletions downloads/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2635,20 +2635,23 @@ paths:
evaluation:
- run_id: "1"
task_id: "68"
uploader: "1"
flow_id: "61"
function: area_under_roc_curve
upload_time: 2014-04-06 23:30:40
value: "0.839359"
array_data: '[0,0.99113,0.898048,0.874862,0.791282,0.807343,0.820674]'
- run_id: "1"
task_id: "68"
uploader: "1"
flow_id: "61"
function: f_measure
upload_time: 2014-04-06 23:30:40
value: "0.600026"
array_data: '[0,0,0.711934,0.735714,0.601363,0.435678,0.430913]'
- run_id: "1"
task_id: "68"
uploader: "1"
flow_id: "61"
function: predictive_accuracy
upload_time: 2014-04-06 23:30:40
Expand Down Expand Up @@ -2914,15 +2917,15 @@ paths:
parameters:
- name: id
in: path
description: Id of the study.
description: Id of the study. Supplied in the URL path.
required: true
type: number
format: integer
- name: description
- name: ids
in: formData
description: An XML file describing the entities to be attached. Also see the [XSD schema](https://www.openml.org/api/v1/xsd/openml.study.attach) and an [XML example](https://www.openml.org/api/v1/xml_example/attach).
description: Comma-separated list of entity IDs to be attached to the study. For instance, if this is a run study, the list of run IDs that need to be added (attached) to the study. Must be supplied as a POST variable.
required: true
type: file
type: string
- name: api_key
in: query
description: Api key to authenticate the user
Expand Down Expand Up @@ -2971,11 +2974,11 @@ paths:
required: true
type: number
format: integer
- name: description
- name: ids
in: formData
description: An XML file describing the entities to be detached. Also see the [XSD schema](https://www.openml.org/api/v1/xsd/openml.study.detach) and an [XML example](https://www.openml.org/api/v1/xml_example/detach).
description: Comma-separated list of entity IDs to be detached from the study. For instance, if this is a run study, the list of run IDs that need to be removed (detached) from the study. Must be supplied as a POST variable.
required: true
type: file
type: string
- name: api_key
in: query
description: Api key to authenticate the user
Expand Down Expand Up @@ -3052,6 +3055,38 @@ paths:
500 - No model performance estimation procedures available.
schema:
$ref: '#/definitions/Error'
/user/list:
get:
tags:
- user
summary: List all users by user id
description: |
Returns an array with all user ids and names.
parameters:
- name: api_key
in: query
description: API key to authenticate the user
required: false
type: string
responses:
200:
description: A list of users
examples:
application/json: |-
{
"users":{
"user":[
{
"id":"1",
"username":"janvanrijn@gmail.com"},
{
"id":"2",
"username":"joaquin.vanschoren@gmail.com"}
]
}
}
schema:
$ref: '#/definitions/UserList'
/evaluationmeasure/list:
get:
tags:
Expand Down Expand Up @@ -3095,6 +3130,11 @@ definitions:
properties:
flows:
$ref: '#/definitions/FlowList_flows'
UserList:
type: object
properties:
users:
$ref: '#/definitions/UserList_users'
Task:
type: object
properties:
Expand Down Expand Up @@ -3563,6 +3603,20 @@ definitions:
type: array
items:
$ref: '#/definitions/FlowList_flows_flow'
UserList_users_user:
properties:
id:
type: string
description: The user ID
username:
type: string
description: The full user name
UserList_users:
properties:
user:
type: array
items:
$ref: '#/definitions/UserList_users_user'
Task_task_description_data_set:
properties:
data_set_id:
Expand Down
4 changes: 3 additions & 1 deletion openml_OS/helpers/api_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ function validateXml( $xmlDocument, $xsdDocument, &$xmlErrors, $from_file = true
else
$xml->loadXML( $xmlDocument );

$cxmlErrors = '';
foreach (libxml_get_errors() as $error) {
$xmlErrors .= $error->message . '. ';
}
Expand All @@ -19,6 +18,9 @@ function validateXml( $xmlDocument, $xsdDocument, &$xmlErrors, $from_file = true
return true;
} else {
$xmlErrors .= 'XML does not correspond to XSD schema. ';
foreach (libxml_get_errors() as $error) {
$xmlErrors .= 'Error ' . $error->message . ' on line ' . $error->line . ' column ' . $error->column . '. ';
}
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion openml_OS/models/api/v1/Api_evaluation.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ private function evaluation_list($segs, $user_id) {
// TODO: remove dependency on task_inputs and dataset table
// TODO (2): transform into subquery where all columns except evaluation_fold are obtained in subquery (along with limit requirements, as MYSQL query optimizer does not seem to understand this query has an upper limit to the number of obtained runs that need to be inspected)
$sql =
'SELECT r.rid, r.task_id, r.start_time, s.implementation_id, s.sid, f.name AS `function`, i.fullName, d.did, d.name, e.evaluation_engine_id, ' . $columns . ' ' .
'SELECT r.rid, r.task_id, r.start_time, r.uploader, s.implementation_id, s.sid, f.name AS `function`, i.fullName, d.did, d.name, e.evaluation_engine_id, ' . $columns . ' ' .
'FROM run r, ' . $eval_table . ' e, algorithm_setup s, implementation i, dataset d, task t, task_inputs ti, math_function f ' .
'WHERE r.setup = s.sid ' .
'AND e.source = r.rid ' .
Expand Down
10 changes: 9 additions & 1 deletion openml_OS/models/api/v1/Api_study.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ private function study_create() {
);

$study_id = $this->Study->insert($schedule_data);
if (!$study_id) {
$this->db->trans_rollback();
$this->returnError(1039, $this->version, $this->openmlGeneralErrorCode, 'Problem creating study record. Please check whether the alias is unique. ');
return;
}

$res = $this->_link_entities($study_id, $this->user_id, $link_entities);

Expand Down Expand Up @@ -519,7 +524,10 @@ private function _link_entities($study_id, $uploader_id, $link_entities) {
'uploader' => $uploader_id,
'date' => now(),
);
$this->{$model}->insert($data);
$result = $this->{$model}->insert($data);
if (!$result) {
return false;
}
}
return true;
}
Expand Down
27 changes: 27 additions & 0 deletions openml_OS/models/api/v1/Api_user.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ function __construct() {

function bootstrap($format, $segments, $request_type, $user_id) {
$this->outputFormat = $format;

# http://test.openml.org/api/v1/user/list/uploader/1,2
if (count($segments) >= 1 && $segments[0] == 'list') {
array_shift($segments);
$this->username_list($segments);
return;
}

/*$getpost = array('get','post');

Expand Down Expand Up @@ -74,5 +81,25 @@ function bootstrap($format, $segments, $request_type, $user_id) {
$this->_xmlContents( 'user-delete', array( 'user' => $user ) );
} */


private function username_list($segs) {
# pass uploader list to get username list
$legal_filters = array('user_id');
$query_string = array();
for ($i = 0; $i < count($segs); $i += 2) {
$query_string[$segs[$i]] = urldecode($segs[$i+1]);
if (in_array($segs[$i], $legal_filters) == false) {
$this->returnError(370, $this->version, $this->openmlGeneralErrorCode, 'Legal filter operators: ' . implode(',', $legal_filters) .'. Found illegal filter: ' . $segs[$i]);
return;
}
}
$user_id = element('user_id', $query_string);
$users = $this->Author->getWhere('`id` IN (' . $user_id . ')');
$this->xmlContents('user-name', $this->version, array('users' => $users));
}

}



?>
1 change: 1 addition & 0 deletions openml_OS/views/pages/api_new/v1/json/data.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"version":<?php echo $data->version; ?>,
"status":"<?php echo $data->status; ?>",
"format":"<?php echo $data->format; ?>",
"md5_checksum":"<?php echo $data->md5_checksum; ?>",
<?php if ($data->file_id != null): /* optional field! */?>
"file_id": <?php echo $data->file_id; ?>,
<?php endif; ?>
Expand Down
Loading