Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
400e7c9
fixed link
joaquinvanschoren Jul 9, 2019
67e0386
ES bugfix
joaquinvanschoren Jul 9, 2019
f28500f
setup api docs
joaquinvanschoren Jul 9, 2019
4d7fad6
apidocs fix
joaquinvanschoren Aug 8, 2019
be99cd7
Return the reason why the XML was not valid according to the XSD
joaquinvanschoren Aug 14, 2019
9edcf1e
force download of RDF files
joaquinvanschoren Aug 16, 2019
19d8b5c
add uploader to evaluation_list
sahithyaravi Sep 5, 2019
9010ff3
add user_id to name
sahithyaravi Sep 9, 2019
9a082e0
add to initial check
sahithyaravi Sep 9, 2019
6eadfcf
list of user names
sahithyaravi Sep 9, 2019
22d9466
add username tpl to views and remove from_id function
sahithyaravi Sep 9, 2019
f3937b6
remove extra brace
sahithyaravi Sep 9, 2019
d2ae6c3
add uploader to evaluations
sahithyaravi Sep 9, 2019
6201bb7
Merge pull request #998 from openml/fix_982
joaquinvanschoren Sep 9, 2019
f80f41d
change uploader to user
sahithyaravi Sep 9, 2019
783dca3
change uploader to user
sahithyaravi Sep 9, 2019
db41def
Merge branch 'fix_982' of https://github.com/openml/OpenML into fix_982
sahithyaravi Sep 9, 2019
e5b14ed
doc update
joaquinvanschoren Sep 9, 2019
9128b66
doc update
joaquinvanschoren Sep 9, 2019
21c0d7f
Delete swagger.json
joaquinvanschoren Sep 9, 2019
83020bb
Delete swagger.yaml
joaquinvanschoren Sep 9, 2019
0d2626f
Merge pull request #993 from openml/joaquinvanschoren-patch-4
joaquinvanschoren Sep 11, 2019
c70f183
Merge branch 'master' into develop
joaquinvanschoren Sep 11, 2019
8ddeda7
Merge pull request #995 from openml/joaquinvanschoren-patch-5
joaquinvanschoren Sep 12, 2019
79c587a
review comments
sahithyaravi Sep 12, 2019
87748a3
add space
sahithyaravi Sep 12, 2019
aeab1e7
extended error messages
janvanrijn Sep 16, 2019
d673142
better error handling
janvanrijn Sep 16, 2019
582042e
increase stat circles on cover page
joaquinvanschoren Sep 24, 2019
2253cd7
indentation changes
sahithyaravi Sep 25, 2019
9e45e3d
two spaces
sahithyaravi Sep 25, 2019
9bf927c
fix code style
sahithyaravi Sep 27, 2019
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/xml/evaluations.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<?php foreach( $evaluations as $e ): ?>
<oml:evaluation>
<oml:run_id><?php echo $e->rid; ?></oml:run_id>
<oml:uploader><?php echo $e->uploader; ?></oml:uploader>
<oml:task_id><?php echo $e->task_id; ?></oml:task_id>
<oml:setup_id><?php echo $e->sid; ?></oml:setup_id>
<oml:flow_id><?php echo $e->implementation_id; ?></oml:flow_id>
Expand Down
Loading