3
dM              	   @   s   d dl mZmZmZmZmZ d dlZdd Zdd Zdd Z	d	d
 Z
dd Zdd Zdd Zdd Zdd Zdefdefdefde	fde
fdefdefdefgZdS )    )ProvDocument	NamespaceLiteralPROV
IdentifierNc              C   s>  t  } tdd}| jdd | jdd | j|d dd	i | j|d
  | j|d  | j|d  | j|d  | j|d  | j|d  | j|d  | j|d  | j|d  | jd | jd | jd | jddd | jd | jddddid | jddddid | jd d | jdd  | jd!d | jd!dd" | jd#td$ d%d&d' | j	dd# | j	dd# | jd(td) d*d+ | j
d#d(d | jd!d# | jd,d | jdd | jd,dd-td. id | jd/d, | jd0d1d-td2 id | jd3d1 | jd3d | jd4d1 | jd4d, | jd4d3 | S )5Nexzhttp://example/dctermszhttp://purl.org/dc/terms/foafzhttp://xmlns.com/foaf/0.1/articlezdcterms:titlezCrime rises in cities	articleV1	articleV2dataSet1dataSet2
regionListcompositionchart1chart2	blogEntryz
ex:compilezex:compile2z
ex:composez
ex:correctz2012-03-31T09:21:00z2012-04-01T15:21:00zex:illustratezex:dataSet1z	prov:rolezex:dataToCompose)other_attributeszex:regionListzex:regionsToAggregateByzex:compositionz	ex:chart1z2012-03-02T10:30:00zex:derekPersonDerekz<mailto:derek@example.org>)z	prov:typezfoaf:givenNamez	foaf:mboxzex:chartgenOrganizationzChart Generators Inc)z	prov:typez	foaf:namezex:dataSet2z	prov:typeRevisionz	ex:chart2zex:blogEntryz
ex:article	Quotationzex:articleV1zex:articleV2)r   r   add_namespaceentityactivityusedwasGeneratedByagentr   wasAssociatedWithactedOnBehalfOfwasAttributedTowasDerivedFromspecializationOfalternateOf)gr    r'   3/tmp/pip-build-7vycvbft/prov/prov/tests/examples.pyprimer_example   sp    





r)   c              C   s  t ddddd} | jdddi}| jd	}| jd
}| jd}| jd}| jd}| jd}| jd}| jd}	| jd}
| jd}| jd}| jd}| jddd}| jd}|j|ddid |j|ddid |j| |j| |j| |j|d | jdtd d d!d"}|j| |j| | jd#td$ d%d&}|j|| |j	| |j| |j| |j
|d'td( id |	j
| |
j
|d'td) id |j| |j
| |j| |j
| |j| | S )*Nzhttp://example/zhttp://purl.org/dc/terms/zhttp://xmlns.com/foaf/0.1/)r   r   r	   )
namespacesz
ex:articlezdcterms:titlezCrime rises in citieszex:articleV1zex:articleV2zex:dataSet1zex:dataSet2zex:regionListzex:compositionz	ex:chart1z	ex:chart2zex:blogEntryz
ex:compilezex:compile2z
ex:composez
ex:correctz2012-03-31T09:21:00z2012-04-01T15:21:00zex:illustratez	prov:rolezex:dataToCompose)
attributeszex:regionsToAggregateByz2012-03-02T10:30:00zex:derekr   r   z<mailto:derek@example.org>)z	prov:typezfoaf:givenNamez	foaf:mboxzex:chartgenr   zChart Generators Inc)z	prov:typez	foaf:namez	prov:typer   r   )r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   )r&   r
   r   r   r   r   r   r   r   r   r   compileZcompile2ZcomposecorrectZ
illustrateZderekZchartgenr'   r'   r(   primer_example_alternate   s`    



























r.   c              C   sd  t  } | jdd | jdd | jdd | jdd | jd	d
 | jdd | jdd | jdd | jdddi | jdddi | jdddi | jdddi | jdddi | jdddi | jdd | jdddid | jdddid | jdd | jdd | jdd | jdd | jdd | jd dd!id | jdd d | jdd d | S )"Nr   zhttp://example.org/w3zhttp://www.w3.org/trzhttp://www.w3.org/TR/2011/processz3http://www.w3.org/2005/10/Process-20051014/tr.html#emailz1https://lists.w3.org/Archives/Member/w3c-archive/Zchairsz,https://lists.w3.org/Archives/Member/chairs/Ztransz.http://www.w3.org/2005/08/01-transitions.html#Zrec54z"http://www.w3.org/2001/02pd/rec54#ztr:WD-prov-dm-20111018z	prov:typezrec54:WDztr:WD-prov-dm-20111215zprocess:rec-advancez	prov:Planzchairs:2011OctDec/0004ztrans:transreqzemail:2011Oct/0141ztrans:pubreqzemail:2011Dec/0111zex:act1publish)r   zex:act2zw3:Consortiumr   )	r   r   r   r#   r   r   r   r   r    )r&   r'   r'   r(   w3c_publication_1   s6    /r4   c              C   s   t dd} t dd}t dd}t dd}t }|j|d	 d
di |j|d d
di |j| d d d d
di |jdd|d d |jdd
tdi |jdddd |jdd |jddddd |jdd
di |j	dd |S )Nr   zhttp://example.org/reczhttp://example.org/recordr/   zhttp://www.w3.org/TR/2011/hgzThttp://dvcs.w3.org/hg/prov/raw-file/9628aaff6e20/model/releases/WD-prov-dm-20111215/zOverview.htmlz	prov:typez
file in hgzWD-prov-dm-20111215Zhtml4Zrcpzcopy directoryzw3:WD-prov-dm-20111215zex:rcpr&   )
identifierzex:req3z4http://www.w3.org/2005/08/01-transitions.html#pubreqzhg:Overview.htmlzrec:uzrec:gzex:webmasterr   )
r   r   r   r   r   r   r   r#   r   r    )r   r5   r/   r6   r&   r'   r'   r(   w3c_publication_2#  s,    #



r8   c              C   s  t  } tdd}| j| | jdd | jdd | jddtd	 i | jdd
d | jd | jdd | jddtd	 i | jddd | jd | jdd | jd}|jdddd |jddd | jd}|jd |jdddd |jddd |j	dd | S )Nr   zhttp://www.example.com/alicezhttp://example.org/alice/bobzhttp://example.org/bob/zbob:bundle1z	prov:typeBundlez2012-05-24T10:30:00)timezex:Bobzalice:bundle2z2012-05-25T11:15:00zex:Alicez
ex:report1report   )z	prov:typez
ex:versionz2012-05-24T10:00:01z
ex:report2   z2012-05-25T11:00:01)
r   r   r   r   r   r   r   r"   bundler#   )r&   ZEXZb1Zb2r'   r'   r(   bundles1n  s,    






rA   c              C   s  t  } | jdd | jdd | jdd | jddtd	 i | jdd
d | jd | jdd | jddtd	 i | jddd | jd | jdd | jd}|jdddd |jddd | jd}|jd |jddd |jdddg |jddd |j	dd | S )Nr   zhttp://www.example.com/r9   zhttp://example.org/alice/r:   zhttp://example.org/bob/zbob:bundle4	prov:typer;   z2012-05-24T10:30:00)r<   zex:Bobzalice:bundle5z2012-05-25T11:15:00zex:Alicez
ex:report1r=   r>   )z	prov:typez
ex:versionz2012-05-24T10:00:01zex:report1bisz
ex:report2
ex:versionr?   z2012-05-25T11:00:01)rB   r=   )rC   r?   )
r   r   r   r   r   r   r"   r@   Z	mentionOfr#   )r&   Zb4Zb5r'   r'   r(   bundles2  s,    


	

rD   c              C   s8   t  } tdd}| j|d }| jd}| j|| | S )Nr   zhttp://example.org/c1zex:e1)r   r   Z
collectionr   Z	hadMember)r&   r   rE   Ze1r'   r'   r(   collections  s    

rF   c              C   sh   t  } tdd}| j| ddddddtjd	d
d
dddtdtd dd}d}||d< | jd| | S )Nr   zhttp://example.org/d   gY@l   2}r TzSome stringu6   Some unicode string with accents: Huỳnh Trung Đôngi           0   zPROV Internationalized stringZInternationalizedStringen)zex:intzex:floatzex:longzex:boolzex:strz
ex:unicodezex:timedatez	ex:intstrzLine1
    Line2
Line3zex:multi-linezex:e1)r   r   r   datetimer   r   r   )r&   r   r+   	multiliner'   r'   r(   	datatypes  s     

rO   c              C   s2   t  } d}td|}| j| | jdddi | S )Na)  http://Lorem.ipsum/dolor/sit/amet/consectetur/adipiscing/elit/Quisque/vel/sollicitudin/felis/nec/venenatis/massa/Aenean/lectus/arcu/sagittis/sit/amet/nisl/nec/varius/eleifend/sem/In/hac/habitasse/platea/dictumst/Aliquam/eget/fermentum/enim/Curabitur/auctor/elit/non/ipsum/interdum/at/orci/aliquam/r   zex:e1z
prov:labela  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec pellentesque luctus nulla vel ullamcorper. Donec sit amet ligula sit amet lorem pretium rhoncus vel vel lorem. Sed at consequat metus, eget eleifend massa. Fusce a facilisis turpis. Lorem volutpat.)r   r   r   r   )r&   Zlong_urir   r'   r'   r(   long_literals  s    


rP   ZBundle1ZBundle2ZPrimerzW3C Publication 1zW3C Publication 2zLong literals)Z
prov.modelr   r   r   r   r   rM   r)   r.   r4   r8   rA   rD   rF   rO   rP   testsr'   r'   r'   r(   <module>   s&    FUK9: