# cdk 2006-04-29
#
# run with
# python cwm.py http://dig.csail.mit.edu/TAMI/cdk/scenario3/data.n3 http://dig.csail.mit.edu/TAMI/cdk/scenario3/schema.n3 http://dig.csail.mit.edu/TAMI/cdk/scenario3/rules.n3 --think --filter="http://dig.csail.mit.edu/TAMI/cdk/scenario3/filter.n3"


@keywords is, of, a .

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix : <#> .

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix foaf: <http://xmlns.com/foaf/0.1#> . 
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix string: <http://www.w3.org/2000/10/swap/string#>.

@prefix u: <http://niem.gov/niem/universal/0.1#>.
@prefix s: <http://niem.gov/niem/structures/0.1#>.
@prefix c: <http://niem.gov/niem/common/0.1#>.
@prefix j: <http://www.niem.gov/niem/domains/justice/0.1#>.
@prefix emer: <http://www.niem.gov/niem/domains/emergency-management/0.1#>.
@prefix int: <http://www.niem.gov/niem/domains/intelligence/0.1#>.
@prefix air: <http://www.megginson.com/exp/ns/airports#>.

@prefix log: <http://www.w3.org/2000/10/swap/log#> .

@prefix ts: <http://dig.csail.mit.edu/TAMI/cdk/scenario3/schema.n3#> .
@prefix td: <http://dig.csail.mit.edu/TAMI/cdk/scenario3/data.n3#> .
@prefix tr: <http://dig.csail.mit.edu/TAMI/cdk/scenario3/rules.n3#> .

############################################# data of scenario3 ############################################

td:JohnDoe a ts:Subject
	; ts:name
		[ u:personGivenName "John"
		; u:personMiddleName "Henry"
		; u:personSurName "Doe"
		]
	; ts:birthDate "1975-08-24"
	; ts:homeAddress
		[ u:locationAddress "123 Main Street"
		; u:locationCityName "New York"
		; u:locationStateName "NY"
		; u:locationPostalCodeID "10044"
		]
.

td:AliceDoe a ts:Subject
	; ts:name
		[ u:personGivenName "Alice"
		; u:personMiddleName "Liddell"
		; u:personSurName "Doe"
		]
	; ts:homeAddress
		[ u:locationAddress "325 Beacon Street"
		; u:locationCityName "Boston"
		; u:locationStateName "MA"
		; u:locationPostalCodeID "02111"
		]
.

td:RobinsonDuckworth a ts:Official
	; ts:name
		[ u:personGivenName "Robinson"
		; u:personMiddleName ""
		; u:personSurName "Duckworth"
		]
	; ts:work
		[ ts:position td:CriminalInvestigator                               ################ cdk
		; ts:employer td:TSA
		]
.

td:CharlesDodgson a ts:Official
	; ts:name
		[ u:personGivenName "Charles"
		; u:personMiddleName "Lutwidge"
		; u:personSurName "Dodgson"
		]
	; ts:work
		[ ts:position td:SpecialAgent                         ################ cdk
		; ts:employer td:FBI
		]
.

td:ChristianAbelman a ts:Official
	; ts:name
		[ u:personGivenName "Christian"
		; u:personMiddleName "M."
		; u:personSurName "Abelman"
		]
	; ts:work
		[ ts:position td:AssistantUSAttorney	                         ################ cdk
		; ts:employer td:USAO-NY
		]
.

td:AnnaLiszt a ts:Official
	; ts:name
		[ u:personGivenName "Anna"
		; u:personMiddleName ""
		; u:personSurName "Liszt"
		]
	; ts:work
		[ ts:position td:IntelligenceAnalyst
		; ts:employer td:FBI
		]
.

td:MattDillon a ts:Official
	; ts:name
		[ u:personGivenName "Matthew"
		; u:personMiddleName ""
		; u:personSurName "Dillon"
		]
	; ts:work
		[ ts:position td:DeputyMarshal
		; ts:employer td:Marshals
		]
.

td:JosephCrater a ts:Official
	; ts:name
		[ u:personGivenName "Joseph"
		; u:personMiddleName "F."
		; u:personSurName "Crater"
		]
	; ts:work
		[ ts:position td:Judge
		; ts:employer td:NYCFC
		]
.


############### Organizations


td:FBI a ts:Organization
	; ts:organizationName "Federal Bureau of Investigation"
	; dc:identifier <http://www.fbi.gov/>
	; ts:office					# cuidado con office y address!!!!!!!
		[ ts:address
			[ u:locationCityName "New York"
	 		; u:locationStateName "NY"
			]
		]
	; ts:partOf td:DOJ
.

td:TSA a ts:Organization
	; ts:organizationName "Transportation Security Administration"
	; dc:identifier <http://www.tsa.gov/>
	; ts:office
		[ ts:address
			[ u:locationCityName "Washington"
	 		; u:locationStateName "DC"
			]
		]
	; ts:partOf td:DHS
.

td:JTTF a ts:Organization
	; ts:organizationName "Joint Terrorism Task Force"
	; ts:office
		[ ts:address
			[ u:locationCityName "New York"
			; u:locationStateName "NY"]
		]
	; ts:partOf td:FBI
.

td:Marshals a ts:Organization
	; ts:organizationName "US Marshals Service"
	; dc:identifier <http://www.usmarshals.gov/>
	; ts:office
		[ ts:address
			[ u:locationCityName "New York"
			; u:locationStateName "NY"
			]
		]
	; ts:partOf td:DOJ
.

td:USAO a ts:Organization
	; ts:organizationName "United States Attorney's Office"
	; dc:identifier <http://www.usdoj.gov/usao/>
	; ts:office
		[ ts:address
			[ u:locationCityName "New York"
			; u:locationStateName "NY"
			]
		]
	; ts:partOf td:DOJ
.

td:NYCFC a ts:Organization
	; ts:organizationName "New York City Family Court"
	; dc:identifier <http://www.nycourts.gov/courts/nyc/family/>
.

td:MCC a ts:Organization
	; ts:organizationName "Metropolitan Correctional Center"
.

td:DHS a ts:Organization
	; ts:organizationName "Department of Homeland Security"
	; dc:identifier <http://www.dhs.gov/>
	; ts:partOf td:FEB
.

td:FEB a ts:Organization
	; ts:organizationName "Federal Executive Branch"
	; ts:partOf td:USG
.

td:USG a ts:Organization
	; ts:organizationName "United States Government"
	; dc:identifier <http://www.firstgov.gov/>
.

td:FR a ts:Organization
	; ts:organizationName "Federal Register"
	; dc:identifier <http://www.gpoaccess.gov/fr/>
	; ts:partOf td:FEB
.


td:DOJ a ts:Organization
	; ts:organizationName "Department of Justice"
	; dc:identifier <http://www.usdoj.gov/>
	; ts:partOf td:FEB
.

td:TSC a ts:Organization
	; dc:title "Terrorism Screening Center"
	; ts:partOf td:FBI
.

td:BOP a ts:Organization
	; dc:title "Federal Bureau of Prisons"
	; dc:identifier <http://www.bop.gov/>
	; ts:partOf td:DOJ
.


td:TSDB a ts:Database
	; ts:owner [organizationName "Terrorism Screening Center"]
.

td:lexis a ts:Database
	; ts:owner [ts:organizationName "LexisNexis"]
	; ts:nature ts:Commercial
.

td:AA-PNR a ts:Database
	; ts:owner [ts:organizationName "American Airlines"]
	; ts:nature ts:Commercial
.


## SOR data

td:SFDB a ts:Sorn
	; ts:notice <http://edocket.access.gpo.gov/2005/05-12405.htm>
	; dc:title "Secure Flight Test Records System"
	; dc:date "2005-06-22"
	; dc:publisher td:FR
	; dc:description "Privacy Act of 1974; Systems of Records: Secure Flight Test Records; Privacy Impact Assessment; Secure Flight Test Phase; Notice"
	; dc:identifier "FR Doc. 05-12405"
	; dc:identifier "70 FR 36319"
	; dc:creator td:TSA
	; ts:allowedSource td:TSDB
#	; ts:category td:DataCategory1
#		, td:DataCategory2
#		, td:DataCategory3
#	; ts:purpose td:AuthorizedPurpose1
	; ts:routineUse td:RU1
.


td:RU1 a ts:RoutineUse
	; ts:recipient td:FBI				  # separar oficinas y organizaciones
	; ts:category td:DataCategory3
	; ts:purpose td:CounterTerrorism
	; dc:description "May share where TSA becomes aware of information that may be related to an individual identified in the TSDB."
.

td:DataCategory1 a ts:DataCategory
	; dc:description "Information about people who traveled within the US by commercial passenger air in June 2004."
.

td:DataCategory2 a ts:DataCategory
	; dc:description "Commercial data secured by a TSA contractor to compare with the first type of information."
.

td:DataCategory3 a ts:DataCategory
	; dc:description "Information about people who are known or reasonably suspected to be or have been engaged in conduct constituting, in preparation for, in aid of, or related to terrorism."
.

td:AuthorizedPurpose1 a ts:Activity
	; dc:description "Enhance the security of domestic air travel by identifying passengers who warrant further scrutiny prior to boarding an aircraft."
.


td:GeneralLaw a ts:LegalSystem
.
td:CriminalLaw a ts:LegalSystem
.
td:CivilLaw a ts:LegalSystem
.

td:GovernmentActivity a ts:Activity
.

td:LawEnforcement a ts:Activity
	; dc:title "Law enforcement"
	; td:legalSystem td:GeneralLaw
	; td:specializationOf td:GovernmentActivity
.

td:CriminalLawEnforcement a ts:Activity
	; dc:title "Criminal law enforcement"
	; ts:legalSystem td:CriminalLaw
	; ts:specializationOf td:LawEnforcement
.

td:Intelligence a ts:Activity
	; dc:title "Intelligence"
	; ts:specializationOf td:GovernmentActivity
.

td:CounterTerrorism a ts:Activity
	; dc:title "Counter-terrorism"
	; ts:specializationOf td:GovernmentActivity
.

td:CT-CriminalLawEnforcement a ts:Activity
	; dc:title "Counter-terrorism - criminal law enforcement"
	; ts:specializationOf td:CounterTerrorism
	; ts:specializationOf td:CriminalLawEnforcement
.

td:CT-Intelligence a ts:Activity
	; dc:title "Counter-terrorism - intelligence"
	; ts:specializationOf td:CounterTerrorism
	; ts:specializationOf td:Intelligence
.

########################################### transactions from scenario3 #####################################3

# <!-- (0) -->

td:receive-pnr-1 a ts:Transfer
	; xsd:dateTime "2004-06-14"
	; ts:sender td:AA-PNR
	; ts:recipient td:TSA
	; ts:category td:DataCategory1
	; ts:purpose td:AuthorizedPurpose1  ##
	; ts:sorn td:SFDB
	; ts:logOwner td:TSA
	; ts:content td:pnr-1
.

td:pnr-1 a ts:PassengerNameRecord
	; ts:passenger
		[ ts:name
			[ u:personGivenName "John"
		 	; u:personMiddleName "Henry"
			; u:personSurName "Doe"
			]
		; ts:birthDate "1975-08-24"
		]
	; ts:flight
		[ ts:number "723"
		; dc:date "2004-06-14"
		; ts:origin td:LGA
		; ts:destination td:ORD
		]
.


# <!-- Automated Secure Flight Test (1) -->

td:flight-test-search-1 a ts:Search
	; xsd:dateTime "2005-09-12T11:30:00"
	; ts:antecedent td:receive-pnr-1
	; dc:identifier "Secure Flight Test"
	; ts:query
		[ ts:aboutPerson
			[ ts:name
		      		[ u:personGivenName "John"
		         	; u:personMiddleName "Henry"
			        ; u:personSurName "Doe"
				]
			; ts:birthDate "1975-08-24"
			]
       		]

################# aqui ####################

	; ts:result td:flight-test-search-1-1
	; ts:result td:flight-test-search-1-2
	; ts:result td:flight-test-search-1-3
.

td:flight-test-search-1-result-1 a ts:Transfer
	; xsd:dateTime "2005-09-12T12:00:00"
	; ts:antecedent td:flight-test-search-1
	; ts:source td:TSDB
	; ts:category td:DataCategory3
	; ts:purpose td:AuthorizedPurpose1
	; ts:content
		[ ts:aboutPerson
			[ ts:name
				[ u:personGivenName "John"
		 		; u:personMiddleName "Henry"
		 		; u:personSurName "Doe"
				]
			; ts:birthDate ""
			]
		]
.

td:flight-test-search-1-result-2 a ts:Transfer
	; xsd:dateTime "2005-09-12T12:00:00"
	; ts:antecedent td:flight-test-search-1

	; ts:source td:lexis
	; ts:category td:DataCategory2
	; ts:purpose td:AuthorizedPurpose1

	; ts:content
		[ ts:aboutPerson
			[ ts:name
				[ u:personGivenName "John"
				; u:personMiddleName "Henry"
				; u:personSurName "Doe"
				]
			 ; ts:homeAddress
				[ u:locationAddress "123 Main Street"
				; u:locationCityName "New York"
				; u:locationStateName "NY"
				; u:locationPostalCodeID "10044"
				]
			 ; ts:birthDate "1975-08-24"
			]
		]
.

td:flight-test-search-1-result-3 a ts:Transfer
	; xsd:dateTime "2005-09-12T12:00:00"
	; ts:antecedent td:flight-test-search-1

	; ts:source td:lexis
	; ts:category td:DataCategory2
	; ts:purpose td:AuthorizedPurpose1

	; ts:content
		[ ts:aboutPerson
			[ ts:name
				[ u:personGivenName "John"
				; u:personMiddleName "Henry"
				; u:personSurName "Doe"
				]
			 ; ts:homeAddress
				[ u:locationAddress "723 High Street"
				; u:locationCityName "Seattle"
				; u:locationStateName "WA"
				; u:locationPostalCodeID "98104"
				]
			 ; ts:birthDate "1975-08-24"
			]
		]
.


# <!-- TSA Sends Match to FBI (2a) -->

td:transfer-1a a ts:Transfer
	; xsd:dateTime "2005-09-17"
	; ts:antecedent td:flight-test-search-1-result-1

	; ts:category td:DataCategory3
	; ts:purpose td:CT-CriminalLawEnforcement
	; ts:purpose td:CT-Intelligence
	; ts:purpose td:AuthorizedPurpose3
	; dc:Identifier "3556780"
	; ts:logOwner td:TSA
	; ts:sender td:TSA
#	; ts:sender td:RobinsonDuckworth
#	; ts:recipient td:CharlesDodgson
	; ts:recipient td:FBI
	; ts:content td:transfer-1-content
.

# <!-- TSA Sends Match to FBI (2b) -->
td:transfer-1b a ts:Transfer
	; xsd:dateTime "2005-09-17"
	; ts:antecedent td:transfer-1a

	; ts:sender td:TSA
	; ts:category td:DataCategory3
#	; ts:purpose td:CT-Intelligence
#	; ts:purpose td:AuthorizedPurpose2
	; ts:purpose td:AuthorizedPurpose3
	; dc:Identifier "0876553"
	; ts:logOwner td:FBI
	; ts:recipient td:FBI

	; ts:content td:transfer-1-content
.

# horrible

td:transfer-1-content ts:sender RobinsonDuckworth
	; ts:recipient td:CharlesDodgson
	; ts:subject td:JohnDoe
	; ts:text "Secure flight match. Possible terror suspect."
.

#/horrible

#<!-- FBI opens an investigation (3) -->

td:open-investigation-1 a ts:OpeningCase
	; xsd:dateTime "2005-09-18T15:00:00"
	; ts:antecedent td:transfer-1b
	; ts:opens td:investigation-1
.

td:investigation-1 a ts:Case
	; c:caseTrackingID "555NY5678"
	; c:caseCategory td:AuthorizedPurpose3	 #  case-category ???
	; ts:agent td:CharlesDodgson
	; ts:agency td:FBI
	; ts:isOpenedBy td:open-investigation-1
.

# <!-- Case assigned to JTTF --> (4)

td:assignment-1 a ts:Assignment
	; ts:subject td:investigation-1
	; ts:recipient td:JTTF
.

td:assignment-2 a ts:Assignment
	; ts:subject td:investigation-1
	; ts:recipient td:AnnaLiszt
.


# <!-- Analyst searches open source --> (5)

td:open-source-search-2 a Search
	; dateTime "2005-10-02T09:00:00"
	; antecedent td:assignment-2
	; query
		[ aboutPerson
			[ ts:name
				[ u:personGivenName "John"
				; u:personMiddleName "Henry"
				; u:personSurName "Doe"
				]
			; homeAddress
				[ u:locationAddress "123 Main Street"
				; u:locationCityName "New York"
				; u:locationStateName "NY"
				; u:locationPostalCodeID "10044"
				]
			; birthDate "1975-08-24"
			]
		]
	; result td:open-source-search-2-result-1
.

td:open-source-search-2-result-1 a ts:Transfer
	; dateTime "2005-10-02T12:00:01"
	; antecedent td:open-source-search-2
	; source <http://appsext4.dos.state.ny.us/csewarrants_public/cse_search>
	; content td:ny-warrant	# revisar
.


# <!-- US Marshals arrest subject --> (new 6)

:18USC228 a j:ArrestCharge
.

[ dateTime "2005-11-01T10:00:00"
; j:arrestOfficial CharlesDodgson
; j:arrestWarrant :05-NY-2343-CR-JFC
; j:arrestSubject JohnDoe
; j:arrestLocation
	[ u:locationCityName "New York"
	; u:locationStateName "NY"
	]
; j:arrestCharge :18USC228
; j:arrestSubjectRightsReadIndicator "true"
] a j:Arrest
.

