위의 링크의 내용을 정리하였다.
앞서의 글 처럼 구조대로 따라가면 이해할 수 있다.
xAPI의 간단한 구조
가장 간단한 xAPI의 구조는 Actor, Verb , Object 이다.
구조는 아래와 같다.
{ "actor": { "name": "Sally Glider", "mbox": "mailto:sally@example.com" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/experienced", "display": { "en-US": "experienced" } }, "object": { "id": "http://example.com/activities/solo-hang-gliding", "definition": { "name": { "en-US": "Solo Hang Gliding" } } } }
이 데이터를 가지고 확장해 가는 것을 보여준다.
Actor
이름은 같은 이름을 가진 사람이 나올 수 있기 때문에 고유한 속성을 부여해서 관리를 해야 한다.
고유한 속성으로는 아래와 같이 mail 주소를 가질 수 있다.
{ "name": "Sally Glider", "mbox": "mailto:sally@example.com" }
반드시 메일일 필요는 없다 고유한 무엇인가로 구분 할 수 있으면 된다.
아래 처럼 홈페이지와 페이지 이름으로 이것을 구분할 수도 있다.
{ "name": "Sally Glider", "account": { "homePage": "http://twitter.com", "name": "sallyglider434" } }
Verb
동사는 아래 처럼 무엇인가의 경험을 표시 할 수 있지만, 다양한 표현을 모두 할 수 있다.
요컨도 동사도 의미를 부여하면서도 , 구분 할 수 있으면 된다는 점이다.
아래에 동사의 예제들을 나열 하였다.
“experienced”, “attended”, “attempted”, “completed”, “passed”, “failed”, “answered”, “interacted”, “imported”, “created”, “shared”“voided”
{ "id": "http://adlnet.gov/expapi/verbs/experienced", "display": { "en-US": "experienced" } }
Object
행동의 되는 것이 Object 이다.
id 필드는 고유한 값을 가지고 있어야 한다.
{ "id": "http://example.com/activities/solo-hang-gliding", "definition": { "name": { "en-US": "Solo Hang Gliding" } } }
간단하게 정의 하면 위와 같이 정의 된다.
좀더 필드를 추가하여서 정의가 가능하다.
아래 코드를 참고로 볼 수 있다.
{ "id": "http://example.com/activities/solo-hang-gliding", "definition": { "type": "http://adlnet.gov/expapi/activities/course", "name": { "en-US": "Solo Hang Gliding", "es": "Solo Ala Delta" }, "description": { "en-US": "The 'Solo Hang Gliding' course provided by The Hang Glider's Club", "es": "El curso de 'Solo Ala Delta' siempre por el Club de Planeadores Hang" }, "extensions": { "http://example.com/gliderClubId": "course-435" } } }
object의 id와 “definition” “description” 그리고 “extensions”를 정의하고 사용 할 수 있다.
좀더 자세한 것은 아래 사이트에서 얻을 수 있다.
https://github.com/adlnet/xAPI-Spec/blob/master/xAPI-Data.md#parttwo
Verbs vs. Activities
Verb와 Object의 구분이 못호해 지는 경우가 발생한다.
무엇이 목적이고 무엇이 동사인지 경계가 모호해 지면 그 주체가 무엇인지를 보고 결정해야 한다.
하지만, 이런 것은 해 봐야 아는 문제이다.
xAPI는 동사에 대한 리스트를 정의 해 놓았고 그에 따른 메타 데이터까지 정의 해 놓았다.
https://registry.tincanapi.com/#home/verbs


Context
xAPI 데이터 세트에 정보를 추가할 수 있다.
보통 Object나 actor등등에 대한 추가 정보를 넣어야 할 경우 확장해서 사용할 수 있다.
{ "actor": { "name": "Sally Glider", "mbox": "mailto:sally@example.com" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/experienced", "display": {"en-US": "experienced"} }, "object": { "id": "http://example.com/activities/solo-hang-gliding", "definition": { "type": "http://adlnet.gov/expapi/activities/course", "name": { "en-US": "Solo Hang Gliding" } } }, "context": { "instructor": { "name": "Irene Instructor", "mbox": "mailto:irene@example.com" }, "contextActivities":{ "parent": { "id": "http://example.com/activities/hang-gliding-class-a" }, "grouping": { "id": "http://example.com/activities/hang-gliding-school" } } } }
Result
행위에 대한 결과를 정의 한다.
{ "actor": { "name": "Sally Glider", "mbox": "mailto:sally@example.com" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/completed", "display": {"en-US": "completed"} }, "object": { "id": "http://example.com/activities/solo-hang-gliding", "definition": { "name": { "en-US": "Solo Hang Gliding" } } }, "result": { "completion": true, "success": true, "score": { "scaled": .95 } } }
위의 경우 Sally가 Glider를 타는 것을 완료 했다 라고 데이터를 정의 하는 것이다.
완료 점수는 95%로 성공적으로 완료 했다고 결과를 정의 한 것이다.
Extensions
확장은 특정 객체에 혹은 context 등에 확장 할 수 있다.
확장은 필요한 경우에 필요한 데이터를 추가 할 수 있다.
다만, 확장을 사용할 경우 그 책임은 온전히 사용자(프로토콜 정의한 사람)이 가지고 가야 한다.
편한 만큼 책임도 존재하여야 한다는 의미이다.
{ "actor": { "name": "Sally", "mbox": "mailto:sally@example.com" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/completed", "display": { "en-US": "completed" } }, "object": { "id": "http://example.com/activities/solo-hang-gliding", "definition": { "type": "http://adlnet.gov/expapi/activities/assessment", "name": { "en-US": "Solo Hang Gliding" }, "extensions": { "http://example.com/gliderClubId": "test-435" } } }, "result": { "completion": true, "success": true, "extensions": { "http://example.com/flight/averagePitch": 0.05 } }, "context": { "extensions": { "http://example.com/weatherConditions": "rainy" } } }
위의 경우 Object에 glider club id 필드를 사용하여서 “솔로 행글라이딩”에 대한 평가를 정의하는 확장 요소를 정의하고 보여주고 있다.
또한 context에서
“날씨” 정보를 extension으로 제공하고 있다.
Other statement fields
{ "actor": { "name": "Sally Glider", "mbox": "mailto:sally@example.com" }, "verb": { "id": "http://adlnet.gov/expapi/verbs/completed", "display": { "en-US": "completed" } }, "object": { "id": "http://example.com/activities/hang-gliding-test", "definition": { "type": "http://adlnet.gov/expapi/activities/assessment", "name": { "en-US": "Hang Gliding Test" }, "description": { "en-US": "The Solo Hang Gliding test, consisting of a timed flight from the peak of Mount Magazine" }, "extensions": { "http://example.com/gliderClubId": "test-435" } } }, "result": { "completion": true, "success": true, "score": { "scaled": 0.95 }, "extensions": { "http://example.com/flight/averagePitch": 0.05 } }, "context": { "instructor": { "name": "Irene Instructor", "mbox": "mailto:irene@example.com" }, "contextActivities":{ "parent": { "id": "http://example.com/activities/hang-gliding-class-a" } "grouping": { "id": "http://example.com/activities/hang-gliding-school" } }, "extensions": { "http://example.com/weatherConditions": "rainy" } }, "timestamp": "2012-07-05T18:30:32.360Z", "stored": "2012-07-05T18:30:33.540Z", "authority": { "name": "Irene Instructor", "mbox": "mailto:irene@example.com" } }
그러면 잘 마무리 되는데 상황에 맞추어서 몇가지 추가 필드가 존재한다.
“timestamp” 와 “stored” 필드는 명령문에서 언제 실행(저장)되었는지에 대한 정보를 가지고 있다.
추가적으로 “authority”는 누가 또는 무엇이 이 프로토콜을 발생 시켰는지에 대한 정보를 가지고 있다는 의미이다.
Dive deeper
답글 남기기